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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Calling two cgi scripts from an HTML form

 



DavidUCLA
Deleted

Jul 5, 2000, 1:36 PM

Post #1 of 4 (458 views)
Calling two cgi scripts from an HTML form Can't Post

I can't do this simple thing!

I have a script that runs a survey. I have been able to get two versions of it working, and they generate their own files.

One is called vote3.cgi and the other vote4.cgi

My html currently looks as shown below, but it only calls vote3.cgi.

Is this a problem with my html, or my cgi, and how do I fix it?

Many thanks

</TITLE>
<BODY>
<FORM METHOD=POST ACTION="vote3.cgi">
<p>
<H1>Web Survey</H1>
<INPUT TYPE="HIDDEN" NAME="$user">
<b>Question 1: </b>Please select the description that best fits you:
<p>
<INPUT TYPE="RADIO" NAME="player" VALUE="Potential MBA student">Potential MBA student<br>
<INPUT TYPE="RADIO" NAME="player" VALUE="Current MBA student">Current MBA student<br>
<INPUT TYPE="RADIO" NAME="player" VALUE="Potential Ph.D. student">Potential Ph.D. student<br>
<INPUT TYPE="RADIO" NAME="player" VALUE="Current Ph.D. student">Current Ph.D. student<br>
<INPUT TYPE="RADIO" NAME="player" VALUE="Current Professor">Current Professor<br>
<INPUT TYPE="RADIO" NAME="player" VALUE="Other">Other
<p>
<FORM METHOD=POST ACTION="vote4.cgi">
<p>
<H1>Web Survey</H1>
<INPUT TYPE="HIDDEN" NAME="$user">
<b>Question 1: </b>Please select the description that best fits you:
<p>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Potential student">Potential student<br>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Current student">Current student<br>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Potential stud">Potential stud<br>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Current stud">Current stud<br>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Current Prof">Current Prof<br>
<INPUT TYPE="RADIO" NAME="player2" VALUE="Other">Other
<p>


If you'd like to suggest an alternate description not on the current
list, click on 'other' and enter your suggestion(s) in the 'comments' area.
<p>
<b>Comments: </b><br>
<TEXTAREA NAME="comment" ROWS="3" COLS="50"></TEXTAREA><br>
<INPUT TYPE="SUBMIT" VALUE="Submit Vote"><INPUT TYPE="RESET" VALUE="Reset">
<hr>
<br>


<hr>
Poll stats will be updated with your vote and returned <i>on-the-fly</i>

after your vote has been submitted!
<p>
<p>
&#169; [<a
href="mailto:david.firth@anderson.ucla.edu">david.firth@anderson.ucla.edu</a>]
</FORM>
</BODY>
</HTML>



mckhendry
Deleted

Jul 5, 2000, 1:52 PM

Post #2 of 4 (458 views)
Re: Calling two cgi scripts from an HTML form [In reply to] Can't Post

It looks like you are missing a closing form tag for your form that goes to vote3.cgi. What you probably need to do is before you start your other form tag print a submit button and then close off the previous form. What is happening is since you never close off your previous form all actions go to the first form tag specified. Does that make sense?


Do something like this:

<FORM METHOD=POST ACTION="vote3.cgi">

//radio button stuff goes here

//submit button goes here

</form> //closing form tag here

<FORM METHOD=POST ACTION="vote4.cgi">

//more radio button stuff with explanations

//maybe a javascript button down here that submits vote3.cgi
//do this by:

<input type=button value="submit vote3" onclick="document.vote3.submit()">

// other submit buttons that you currently have go here

Hope this helps.


mckhendry
Deleted

Jul 5, 2000, 1:56 PM

Post #3 of 4 (458 views)
Re: Calling two cgi scripts from an HTML form [In reply to] Can't Post

I forgot to mention, to do the javascript button option you would have to give your top form a name. If you had declared it like such it would work fine.

<form method=post name=vote3 action="vote.cgi">


DavidUCLA
Deleted

Jul 5, 2000, 2:24 PM

Post #4 of 4 (458 views)
Re: Calling two cgi scripts from an HTML form [In reply to] Can't Post

Your answer worked, but presents a problem I was explicitly trying to avoid!!

I don't want to have a "submit vote" button for each question in the survey.

I just want to do it once.

Any thoughts?

Thanks

David

 
 


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

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