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: Need a Custom or Prewritten Perl Program?: I need a program that...:
Multiple Order Form

 



suzbik
Deleted

Mar 18, 2000, 10:56 PM

Post #1 of 2 (780 views)
Multiple Order Form Can't Post

Hi
Does anybody know how i could make a order form that is spread over 4 pages?

Thanks


Jasmine
Administrator

Mar 22, 2000, 5:57 AM

Post #2 of 2 (780 views)
Re: Multiple Order Form [In reply to] Can't Post

You can pass variables from one page to the other using INPUT TYPE=HIDDEN tags in each page of your form.

For example,

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<!-- Page 1 -->
<FORM ACTION = "multipage.cgi" METHOD=POST>
Name: <INPUT TYPE=TEXT NAME="name"><BR>
Email: <INPUT TYPE=TEXT NAME="email"><BR>
<INPUT TYPE=SUBMIT VALUE="Next">
</FORM>
</pre><HR></BLOCKQUOTE>

then on page 2,

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<!-- Page 2 -->
<FORM ACTION = "multipage.cgi" METHOD=POST>
Address: <INPUT TYPE=TEXT NAME="address"><BR>
City: <INPUT TYPE=TEXT NAME="city"><BR>
State: <INPUT TYPE=TEXT NAME="state"><BR>
Zip: <INPUT TYPE=TEXT NAME="zip"><BR>
<INPUT TYPE=HIDDEN NAME="name" VALUE="userinput">
<INPUT TYPE=HIDDEN NAME="email" VALUE="userinput">
<INPUT TYPE=SUBMIT VALUE="Next">
</FORM>
</pre><HR></BLOCKQUOTE>

Now don't put the word userinput as the value of the hidden tag Smile If you happen to use CGI.pm to parse your user input, you would include something like this in your cgi form code for page 2:

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


use CGI;
my $q = new CGI;

# ... more code here

sub page2 {
print qq~
<FORM ACTION = "multipage.cgi" METHOD=POST>
Address: <INPUT TYPE=TEXT NAME="address"><BR>
City: <INPUT TYPE=TEXT NAME="city"><BR>
State: <INPUT TYPE=TEXT NAME="state"><BR>
Zip: <INPUT TYPE=TEXT NAME="zip"><BR>
<INPUT TYPE=HIDDEN NAME="name" VALUE="$q->param('name')">
<INPUT TYPE=HIDDEN NAME="email" VALUE="$q->param(email')">
<INPUT TYPE=SUBMIT VALUE="Next">
</FORM>~;
}
</pre><HR></BLOCKQUOTE>

Hope this helps!


[This message has been edited by Jasmine (edited 03-22-2000).]

 
 


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

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