Form Tags

Below is a listing of form tags with their HTML code.



Tag properties:
type tells the browser what type of form tag to display on the screen Required.
name gives the form tag a name Required.
size tells the browser how long to make the box appear on screen. Required only if the maxlength property not set.   Not required for select lists.
maxlength tells the browser how many characters can be accepted, regardless of how big the box is on the screen. Required.
Not required for select lists.
value used to pass values back to the CGI script. Required for radio buttons, check boxes, select lists, and Sumit/Reset buttons.
checked used to automatically select a radio button or check box value. Optional.
selected used in the <option> tag of a list box to automatically select a value. Optional.

Textbox

<input type="text" name="text1" size=20 maxlength=25>

TextArea

<textarea name="textarea1" rows=4 cols=40></textarea>

Radio Button
(selected)
<input type="radio" name="Radio1" size=3 value="Yes" checked>

(not selected)
<input type="radio" name="Radio1" size=3 value="Yes">

CheckBox
(checked)
<input type="checkbox" name="check1" size=6 value="value1" checked>

(not checked)
<input type="checkbox" name="check1" size=6 value="value1">

Select List

<select name="selectlist">
     <option value="Value1" selected>Value1
     <option value="Value2">Value2
     <option value="Value3">Value3
     <option value="Value4">Value4
</select>

Multiple Select List

<select name="selectlist" multiple>
     <option value="Value1" selected>Value1
     <option value="Value2">Value2
     <option value="Value3" selected>Value3
     <option value="Value4">Value4
</select>

Submit Button

<input type="SUBMIT" name="Submit" value="Submit">

Reset Button

<input type="RESET" name="Reset" value="Reset">