Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    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?

  • #3
    New to the CF scene
    Join Date
    Jan 2003
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.



  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •