Gossamer Forum
Home : General : Perl Programming :

directing html output to frames

Quote Reply
directing html output to frames
Is there a way to direct html to a frame rather than sending it out as a page from a perl script?

So when someone hits a submit button on a form, 2 different frames get updated...
Quote Reply
Re: directing html output to frames In reply to
 
Yes, Use javascript.

I don't know javascript well enought to tell you how, but if you search on infoseek you'll find all kinds of free resources on how to do it.

------------------
The Crowe crowe@chareter.net
www.lit.org Seriously Modded Links 2.0 For Anyone interested in Writing or online Fiction!


Quote Reply
Re: directing html output to frames In reply to
I'd love to find a way to do it within perl. The mission stipulates the user should not need Java or Javascript. Smile

You can direct the contents of one frame with...

print header(-target=>'FRAME_NAME');

with the CGI.pm. But I'm not finding a way to refresh 2 frames...
Quote Reply
Re: directing html output to frames In reply to
I'm not a big cgi.pm user, so I can't speak for that, but AFAIK, you can only change two frames using a client-side script, i.e. JavaScript.

So you have two options:

1) Use JavaScript, either by using the onClick event handler, or by sending a script in the HEAD of the first delivered page, and calling it using a JavaScript onLoad event handler.

2) Make the two frames you want to change part of a separate frameset, and target the new pages into this frame. This would depend on the layout of the page though.

adam
Quote Reply
Re: directing html output to frames In reply to
I'm not sure if this will lead you the correct way, but it might be worth your time to check out Links' admin script. It creates a framed page from Perl, and obviously targets the different frames.

Dan