[mod_python] Frames using psp

Adrien Plisson aplisson-modpython at stochastique.net
Fri Aug 6 11:23:43 EDT 2004

Ole Jacob Hagen wrote:
> Hi,

hello !

> I 've just tried out your suggestion, but a new Frame pops up. It is not 
> using the same bottom frame as I'd like to...

well, you may have mistyped the name of the frames.

 > How do I receive and handles the form data from top_frame in bot_frame?
 > I would also like to keep my frameset.
 > How can I accomplish this?

in your main file (index.html or such) you declare your frameset:
<frameset rows="50%, 50%">
     <frame name="top_frame" src="top_frame.html"/>
     <frame name="bot_frame" src="bot_frame.psp"/>
     <!-- notice the name of the frames -->

in top_frame.html you declare you form:
<!-- the target attribute should match the name of the frame you would like to 
see your results in. the action attribute is the name of the file whose output 
will be displayed in the target frame -->
<form action="bot_frame.psp" method="POST" target="bot_frame">
     <!-- put here any form control you want -->
     <input type="submit" value="update"/>

in bot_frame.psp, just process the data, don't even think of where it's coming 
from or where it's going to, the browser handles that.

for a more practical example goto:

index.html declares the frameset, frame1.html and frame2.cgi are the content of 
the frames. try them in place, or download them to study the code.
it has not been written using psp (i don't have mod_python on this host), but 
using straight python as a cgi. anyway, the method to have form handled in 
other frames is not mod_python specific, but rather client-side specific, so 
any languages should give the same result.

hope this helps.


More information about the Mod_python mailing list