Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-09-2003, 06:12 AM   PM User | #1
kwokhao
New to the CF scene

 
Join Date: Jan 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kwokhao is an unknown quantity at this point
Cool Activate another frame to call a cgi script

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>

<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">
</form>


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
kwokhao is offline   Reply With Quote
Old 01-09-2003, 03:29 PM   PM User | #2
Mhtml
Senior Coder

 
Mhtml's Avatar
 
Join Date: Jun 2002
Location: Sydney, Australia
Posts: 3,531
Thanks: 0
Thanked 1 Time in 1 Post
Mhtml is an unknown quantity at this point
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:
Code:
<script language="javascript">
ContentFrame.src = '<?=PictureUrlVariable?>'
</script>
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?
Mhtml is offline   Reply With Quote
Old 01-10-2003, 01:36 AM   PM User | #3
kwokhao
New to the CF scene

 
Join Date: Jan 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kwokhao is an unknown quantity at this point
Hi,

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.

kwokhao is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:53 AM.


Advertisement
Log in to turn off these ads.