On Wed, 17 Jul 2002 17:17:21 -0400, [EMAIL PROTECTED]
(Andrew Hughes) wrote:

>I have been given the task of creating a multi-page form that will consist
>of 4 parts.  The final page will the list out everything that the users have
>entered and ask if they would like to go back to any of the 4 sections to
>update the information.  Once the users are satisfied with the final
>product, they will print it out.  I know how to do this with multiple
>scripts and html forms and hidden fields.  However, I would like to try to
>use one script with subroutines.  I guess my main stumbling block is passing
>hidden form fields between subroutines.  Can anyone offer me a simple
>example of how to go about passing a form field from one subroutine to
>another subroutine where it is a hidden field using cgi.pm?  And/Or, can
>anyone point me in toward an applicable tutorial?

I like to use here documents, instead of CGI.pm, because it gives me
more control over the output.
Here is an example of a cgi script, which outputs forms with hidden
fields based on the previous submission's input.

You should be able to get the idea.

######start order-action
####buttons#############################################
print<<END_HTML;
<table width=100% border=2 ><tr>
<td align=center bgcolor=#000000><form method=post target=_self
$secure_server_address$cgi_directory/admin.cgi>
<input type=hidden name=PASSWORD value=$input{PASSWORD}>
<input type=hidden name=CUST_ID value=$input{CUST_ID}>
<input type=hidden name=INVACTION value='SHIP'>
<input type=submit value=\"SHIP\">
</form></td>
<td align=center bgcolor=#000000><form method=post target=_self
$secure_server_address$cgi_directory/admin.cgi>
<input type=hidden name=PASSWORD value=$input{PASSWORD}>
<input type=hidden name=CUST_ID value=$input{CUST_ID}>
<input type=hidden name=INVACTION value='EMAIL'>
<input type=submit value=\"Email\">
</form></td>
<td align=center bgcolor=#000000><form method=post target=_self
$secure_server_address$cgi_directory/admin.cgi>
<input type=hidden name=PASSWORD value=$input{PASSWORD}>
<input type=hidden name=CUST_ID value=$input{CUST_ID}>
<input type=hidden name=INVACTION value='EDIT'>
<input type=submit value=\"Edit\">
</form></td>
<td align=center bgcolor=#000000><form method=post target=_self
$secure_server_address$cgi_directory/admin.cgi>
<input type=hidden name=PASSWORD value=$input{PASSWORD}>
<input type=hidden name=CUST_ID value=$input{CUST_ID}>
<input type=hidden name=INVACTION value='BACK ORDER'>
<input type=submit value=\"BACK ORDER\">
</form></td>
<td align=center bgcolor=#000000><form method=post target=_self
$secure_server_address$cgi_directory/admin.cgi>
<input type=hidden name=PASSWORD value=$input{PASSWORD}>
<input type=hidden name=CUST_ID value=$input{CUST_ID}>
<input type=hidden name=INVACTION value='ADD COMMENT'>
<input type=submit value=\"ADD COMMENT\">
</form></td>
END_HTML
print "</tr></table>";
###################################################################


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to