Forms provide a way to prompt the user for information and to carry out
actions based on that input. A form consists of one or more input controls
that the user uses to enter text and select choices. Once the user provides
the input, the form collects the data and sends it to a destination specified
in the form element. To carry out the requested action, the server must
have a script or other service that corresponds to the given destination.
This script processes the information and can perform actions necessary
to process the data.
To create a
form, you use the FORM element to enclose one or more INPUT elements. The
FORM element specifies the action to take when the user has provided the
information. The INPUT elements define the type and function of the input
controls in the form. The following example shows how to combine these
elements to create a form:
<FORM ACTION="http://intranet/survey"
METHOD=POST>
<P>Name
<BR><INPUT
NAME="CONTROL1" TYPE=TEXTBOX VALUE="Your Name">
<P>Password
<BR><INPUT
TYPE="PASSWORD" NAME="CONTROL2">
<P>Color
<BR><INPUT
TYPE="RADIO" NAME="CONTROL3" VALUE="0" CHECKED>Red
<INPUT
TYPE="RADIO" NAME="CONTROL3" VALUE="1">Green
<INPUT
TYPE="RADIO" NAME="CONTROL3" VALUE="2">Blue
<P>Comments
<BR><INPUT
TYPE="TEXTAREA" NAME="CONTROL4" SIZE="20,5" MAXLENGTH="250">
<P><INPUT
NAME="CONTROL5" TYPE=CHECKBOX CHECKED>Send receipt
<P><INPUT
TYPE="SUBMIT" VALUE="OK"><INPUT TYPE="RESET" VALUE="Reset">
</FORM>
This displays
as:
|