Creating the Form
July 31, 2000
For simplicity's sake, and to keep all this new information from getting
garbled in your brain, we are going to create and use a very simple form
that collects only a user's first and last name. If you do not know how to
make an HTML form, you can read Alan Richmond's
introduction to forms at the WDVL or
you can visit Webmonkey
for another easy forms tutorial.
Our form page is very simple, so here is the code (we will leave
action blank until later):
<html>
<head>
<title>ASP Form Sample</title>
</head>
<body>
<form action="" method="get" name="Input_Form">
First Name:
<input type="text" size="30"
maxlength="50" name="First_Name">
<br>
Last Name:
<input type="text" size="30"
maxlength="50" name="Last_Name">
<br>
<input type="submit" value="Submit Form">
</form>
</body>
</html>
This is what our little bit of code produces:
|
TIP:
To make your form fields look nice and aligned on screen, put
them in a simple table with two columns to provide more precise
positioning.
|
If you are following along, save your file as formtest.asp. Or, name
it whatever you want but make certain that the file has the .asp file
extension. If you have access to an NT server, upload the file and
test it to make sure your form is coded correctly. If you do not have
access to an NT server, you may
download Microsoft's Personal Web Server and test the ASP page on your
local machine (Note: When we work with CDONTS later, that will not
work on Personal Web Server, it is supported by only NT Server).
Now on to something a little more difficult (and fun)! How in the world
can we make this form go to my email address at corinth@enfused.com without
popping up that ugly security alert box? It is really easier than you
think. Move on to the next page and I will show you how.
Using ASP for Form Handling
Using ASP for Form Handling
Adding the ASP Code
|