CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Calling CGI



Oct 25, 2001, 2:55 PM

Post #1 of 4 (586 views)
Calling CGI Can't Post

Im making a main CGI in which you can decide to work from 3 CGI'S, now I get them to pick with three submit buttons...
Submit1 calls CGI1
Submit2 calls CG2, etc...

How can I call them from the main CGI and still send some hidden inputs...

These Days, Keep The Faith, Always...


Oct 25, 2001, 3:43 PM

Post #2 of 4 (585 views)
Re: Calling CGI [In reply to] Can't Post

Try passing the input (hidden or otherwise) as parameters (either as text or in a hash) to the CGI scripts that you are calling.

Sean Shrum

User / Moderator

Oct 27, 2001, 12:21 PM

Post #3 of 4 (582 views)
Re: Calling CGI [In reply to] Can't Post

If you know that javascript will be active you can try something like this...

<form method="POST" action="/protein/display.cgi" name="memberform"> 

<input type="submit" name="editmembers" value="Edit"
onclick="forms.memberform.action = 'edit.cgi';">

<input type="submit" name="editmembers" value="Blast"
onclick="forms.memberform.action = 'blast.cgi';">

The only real problem will be if the user disables javascript. So you need to make sure that the default script, in this example 'display.cgi' will be able to determine what to do by looking for which button was pushed and forwarding on to the correct location.


Oct 30, 2001, 2:42 AM

Post #4 of 4 (575 views)
Re: Calling CGI [In reply to] Can't Post

I've seen a version without the javascript.

This should do the trick:
The submit buttons should have identical name="" attributes
Your script will receive a parameter named as the submit button. The value of that parameter is the value="" arrtibute of the button, ie. the text displayed.

Be wise, and use some constants in your script to detect the value. My script failed once because I'd changed the button text.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives