Logo

 

Forms are very important to a good web site. They are necessary in feedback forms, search engines, login pages, trivia pages, and anything else that would allow the user to interact with you.

All the form items must be placed within the <FORM> and </FORM> tags. The attributes that can be placed inside the <FORM> tag are as follows:

methodAccepts either post (more popular) or get
actionTells the CGI script where to process the form


The different input types for a form are as follows:

TextareaA field of text where the user can type comments.
TextA single line text field that allows the user to input a response
PasswordThe same as text, but letters and numbers are replaced by *'s
CheckboxA box the user can click on to put a check mark in their choice
RadioA round object a user can click in to choose one of many choices
HiddenA way to send a value to the server for that form, such as the page name
ResetA button that will erase all the current values inputed on the form
SubmitA button that will send the data to the server specified in ACTION
SelectA drop down box that allows the user to choose one of many choices



Below are examples of what each input type looks like and what the HTML would look like.

Textarea:


<textarea name="My text field" rows="5" cols="30">
This is a text field. This is the default text that appears in the box.
</textarea>


Text:


<input type="text" name="My Text Box" size="10" maxlength="9">

Password:


<input type="password" name="Password Box" SIZE="15" maxlength="14">

Checkbox:
Choice One Choice Two Choice Three

<input type="checkbox" name="Choice One" checked>Choice One
<input type="checkbox" name="Choice Two">Choice Two
<input type="checkbox" name="Choice Three">Choice Three


Radio:
Choice 1 Choice 2 Choice 3 Choice 4 Choice 5

<input type="radio" name="Group 1" value="Choice 1" checked> Choice 1
<input type="radio" name="Group 1" value="Choice 2"> Choice 2
<input type="radio" name="Group 1" value="Choice 3"> Choice 3
<input type="radio" name="Group 1" value="Choice 4"> Choice 4
<input type="radio" name="Group 1" value="Choice 5"> Choice 5


Hidden:
<input type="hidden" name="hidden value" value="My value">

Reset:


<input type="reset" value="Reset the form">

Submit:


<input type="submit" value="Submit the form">



Home 
page

This page was created by Scott Andersen, Eric Schroeder, and Drew Viersen.