View Full Version : Activate another frame to call a cgi script

01-09-2003, 06:12 AM
Hi all,

Need some help here. It might be be a simple one after all :)

I have a page with 2 frame, let's call them MenuFrame and ContentFrame.
Next i have 2 buttons on the MenuFrame, when clicked, will pass a value to a cgi script that will determine which picture to be display and display it on the ContentFrame.

Codes on MenuFrame html:
<form action="cgi-bin/searchPicture.cgi" method="post">
<input type=image name=Button1 src="images/Button.jpg" width="20" height="20" border="0">
<input type="hidden" name="Picture" value="Pic-001">

<form action="cgi-bin/searchPicture.cgi" method="post">
<input type=image name=Button2 src="images/Button.jpg" width="20" height="20" border="0">
<input type="hidden" name="Picture" value="Pic-002">

There's no problem with the cgi script, it searches the correct picture. What happen is that the picture is displayed on the MenuFrame instead of the ContentFrame. Bcos the cgi script is been called from the MenuFrame.

Is there a way to correct this? Perhaps a way to target the ContentFrame in the form action codes?
Something like this:
<form action="cgi-bin/searchPicture.cgi" method="post" target="ContentFrame" >

regards :)

01-09-2003, 03:29 PM
I'm not sure of CGI since I'm an ASP fan, but CGI just processes data and prints it to the page where it is displayed and defined using html, thus can you not just make the CGI code write to a script maybe?

Something like:

<script language="javascript">
ContentFrame.src = '<?=PictureUrlVariable?>'

Like I said though I'm not sure exactly how CGI works but I imagine you can write to the body in that way, if not then CGI should be destroyed ;) ..

Are there only 2 images? If so are they always the same file name?

01-10-2003, 01:36 AM

Thank you for sharing... :)

Actually I'm not a CGI or ASP fan too... more of a Max and Flash fan. :) Picked up basic Perl recently at webmonkey.

I just want to make the post a bit more readable, so that explains why there are only 2 buttons which each assoicated with a pictures.
The final output is supposed to search and display much more pictures. And U know what...that frame I'm targeting is supposed to be in another window too...sigh!

Am I right to say that in the scope of HTML, I can't target a particular frame in a <form> code? Maybe like this:
<form action="cgi-bin/searchPicture.cgi" method="post" target="??ContentFrame??" > ?

Maybe U'r right, I could target the frame from my cgi script instead. Will give that a try.