|
Passing Data with Hidden
Fields by Charles Carroll
This page demonstrates how to have
several pages that are forms yet after all pages are filled out the final form
has access to all inputs without session variables.
surveypage1.asp asks the user the
first questions:
filename=/learn/test/surveypage1.asp
<html><head>
<TITLE>surveypage1.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<form action="surveypage2.asp" method="post">
First Name<br>
<input type="text" name="first" size="20"><br>
Last Name<br>
<input type="text" name="last" size="20">
<p>
<input type="submit" value="Next Question ->"></p>
</form>
</body></html>
surveypage2.asp asks the user the
next questions:
filename=/learn/test/surveypage2.asp
<html><head>
<TITLE>surveypage2.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<form action="surveypage3.asp" method="post">
<%
first=request.form("first")
last=request.form("last")
%>
Hair Color<br>
<input type="text" name="haircolor" size="20"><br>
Favorite Color<br>
<input type="text" name="favoritecolor" size="20">
<p>
<input type="hidden" name="first" value="<%=first%>">
<input type="hidden" name="last" value="<%=last%>">
<input type="submit" value="Next Question ->"></p>
</form>
</body></html>
surveypage3.asp asks the user
yet some more questions:
filename=/learn/test/surveypage3.asp
<html><head>
<TITLE>surveypage3.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
first=request.form("first")
last=request.form("last")
haircolor=request.form("haircolor")
favoritecolor=request.form("favoritecolor")
%>
<form action="surveypage3respond.asp" method="post">
Street Address<br>
<input type="text" name="street" size="20">
<br>
City<br>
<input type="text" name="city" size="20"><br>
State<br>
<input type="text" name="state" size="20">
<br>
Zip<br>
<input type="text" name="zip" size="20">
<br>
<input type="hidden" name="first" value="<%=first%>">
<input type="hidden" name="last" value="<%=last%>">
<input type="hidden" name="haircolor" value="<%=haircolor%>">
<input type="hidden" name="favoritecolor" value="<%=favoritecolor%>">
<input type="submit" value="Final Step ->">
</form>
</body></html>
surveypage3respond.asp gathers
all the answers and responds:
filename=/learn/test/surveypage3respond.asp
<html><head>
<TITLE>surveypage3respond.asp</TITLE>
</head>
<body bgcolor="#FFFFFF">
<%
first=request.form("first")
last=request.form("last")
haircolor=request.form("haircolor")
favoritecolor=request.form("favoritecolor")
street=request.form("street")
city=request.form("city")
state=request.form("state")
zip=request.form("zip")
%>
Thanks for all your information<br>
We are happy to meet you <%=first%> <%=last%><br>
We know your hair color is <%=haircolor%><br>
and your favorite color is <%=favoritecolor%><br>
and we will ship all items to<br>
<%=first%> <%=last%><br>
<%=street%><br>
<%=city%> <%=state%> <%=zip%>
</body></html>
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|