nlafferty has asked for the wisdom of the Perl Monks concerning the following question:

This question is a simple one (I think). I need to use frames in a program. One frame will contain a form. The other should display the results once submitted. The first frame must retain the form information. Sounds simple. ANy simple solutions out there for this one?

Replies are listed 'Best First'.
Re: Frames and CGI
by gellyfish (Monsignor) on Feb 16, 2002 at 21:25 UTC

    You probably want to see the item in the CGI manpage entitled Working with Frames in the first place

    /J\

Re: Frames and CGI
by Dog and Pony (Priest) on Feb 16, 2002 at 22:59 UTC
    Actually, that should be simpler than you think. :)

    Just set the target attribute of your <form> to the name (or id in XHTML) of the target <frame>. That should make the data to be submitted there, and the original frame should not change at all, so it does indeed retain its data. Usually the problem is to get both to update, which makes you have to use javascript or posting to "_top" and redrawing the whole frameset.

Re: Frames and CGI (OT?)
by ViceRaid (Chaplain) on Feb 16, 2002 at 23:10 UTC

    Hmm, if I understand your question, you don't need to get mixed up in the shady world of Perl at all ;). Just use HTML; you can use the TARGET attribute of a form to specify a named HTML window or frame where the result of the form should be displayed.

    <form target="output" method="get" action="/path/to/your/script">

    With this, if you have a frame called 'output', the results of your form will appear there, leaving the completed form in the original frame

    HTH

    {~}
Re: Frames and CGI
by nlafferty (Scribe) on Feb 17, 2002 at 20:43 UTC
    Thanks everyone. It shouldn't be as hard or involved as I originally though.