Chapter 4: Retrieving and Formatting the Data You Want
4.
View the form in a browser.
The form appears in the browser.
Remember that you need an action page in order to submit values; you will create
one later in this chapter.
Code Review
A form appears on the page, ready for user input.
Code
<FORM ACTION="actionpage.cfm" METHOD="POST">
<INPUT TYPE="Text" NAME="FirstName" SIZE="20"
MAXLENGTH="35">
<INPUT TYPE="Text" NAME="LastName" SIZE="20"
MAXLENGTH="35">
<INPUT TYPE="Text" NAME="Salary" SIZE="10"
MAXLENGTH="10">
<SELECT NAME="City">
<OPTION VALUE="Arlington">Arlington
<OPTION VALUE="Boston">Boston
<OPTION VALUE="Cambridge">Cambridge
<OPTION VALUE="Minneapolis">Minneapolis
<OPTION VALUE="Seattle">Seattle
</SELECT>
<input type="checkbox" name="Contractor"
value="Yes|No" checked>Yes
<INPUT TYPE="Reset" NAME="ResetForm"
VALUE="Clear Form">
<INPUT TYPE="Submit" NAME="SubmitForm"
VALUE="Submit">
Description
Gather the information from this form using
the Post method, and do something with it
on the page actionpage.cfm.
Create a text box called FirstName where
users can enter their first name. Make it 20
characters wide, but allow input of up to 35
characters.
Create a text box called LastName where
users can enter their first name. Make it 20
characters wide, but allow input of up to 35
characters.
Create a text box called Salary where users
can enter a salary to look for. Make it 10
characters wide, and allow input of up to 10
characters.
Create a drop down select box named City
and populate it with the values "Arlington,"
"Boston," "Cambridge," "Minneapolis," and
"Seattle."
Create a checkbox that allows users to
specify whether they want to list employees
who are contractors. Have the box checked
by default.
Create a reset button to allow users to clear
the form. Put the text "Clear Form" on the
button.
Create a submit button to send the values
users enter to the action page for processing.
Put the text "Submit" on the button.
33