|
Form Tricks #2: Self-Submitting
Forms
There are some clever tactics programmers can apply
when dealing with forms. They have their drawbacks and should be used sparingly.
Some people prefer to combine their forms and
actions in one file. I don't because of usability issues -- a user who refreshes
a combined form will be presented with a confusing choice "repost form data
(y/n)" which they are not presented with if the forms are separate.
Such a form could be submitted twice accidentally when they just meant to
redisplay the form.
filename=/learn/test/FormSubmitSelf.asp
<html><head>
<title>FormSubmitSelf.asp</title>
</head><body bgcolor="#FFFFFF">
<%
SELECT CASE lcase(request.form("join"))
CASE "join"
response.write "Thanks for joining "
response.write request.form("namefirst") & " "
response.write request.form("namelast") & " "
CASE ELSE
%>
<Form method="post">
Fill Out This Form For Us:<p>
First Name <Input NAME="NameLast" size ="10"><br>
Last Name <Input NAME="NameLast" size ="10"><br>
<input type="submit" name="Join" value="Join">
</form>
<%END SELECT%>
</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.
|  |
 |  |  |
|
|
|
|