This document describes tags used to design and implement interactive forms on a web page.
Click here to skip over the explanatory material at the top of the page and jump straight to the tags.This table:
and these icons:
Support: 2.0, 3.0, 3.2 1.1+ 1.0+
alert you to tags and attributes that are not supported by all browsers. The support page explains the table and the icons in detail.
Not all HTML tags are in this single file. The comprehensive list has been split into the following eight categories:
We have also provided several indexes to help you navigate through this reference. In addition to our main indexes (the compact index and the complete index), there are four other indexes that list the tags according to the standards and browsers that support them.
Willcam's Comprehensive HTML Cross Reference was created as a service to the Internet community, and forms part of Willcam's Internet and HTML curriculum. It represents a joint effort of The Willcam Group and Gregory Consulting and is Copyright 1995 and 1996, The Willcam Group Limited. Please report any errors or omissions to Kate Gregory.
<FORM ACTION=
action base>
form tags</FORM>
method
<FORM METHOD=>
form tags</FORM>
media type
<FORM ENCTYPE=>
form tags</FORM>
<FORM ACTION=
action baseTARGET=
"target window name">
form tags</FORM>
URL
<FORM SCRIPT=>
form tags</FORM>
The form tag introduces a form, which is made up of INPUT elements, described in the sections that follow. A form may be inside structural HTML tags and may also contain structural
tags. Using tables and other elements a form can take on various shapes and looks.
The ACTION attribute defaults to the document's base address.
The METHOD attribute can be GET or POST. GET specifies a query form, used to get data from a server. POST specifies a form that gives information to the server and perhaps causes a
database to be updated or a message to be sent.
The SCRIPT attribute points to a script to be run. The browser must be able to run the type of script that is specified.
The default media type is 'application/x-www-form-urlencoded', which specifies how the browser puts the user responses on the form together to form a response URL that is then
submitted to the server. For more on the CGI compliant scripts that process the form, check the CGI documentation.
If Target is specified then the output document will be loaded into the window specified by "target window name". The following are the predefined target names:
_blank
- Will cause the link to be loaded into a new blank window.
_self
- Will cause the link to be loaded into the same window the link was in.
_parent
- Will cause the link to be loaded into the parent of this document.
_top
- Will cause the link to be loaded into the full body of this window.
<INPUT TYPE=CHECKBOX NAME=
nameVALUE=
value>
name
<INPUT TYPE=CHECKBOX NAME=VALUE=
valueCHECKED>
The checkbox type input tag specifies a boolean choice within the form that contains it. If more than one checkbox appears in the form with the same name the user can select none, one or several of the choices. The NAME attribute is a required field and is used to identify the data for the field. The VALUE attribute specifies the value that is returned if the box is checked. If the CHECKED attribute is specified, the box is initially selected.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
Support: | 3.2 |
<INPUT TYPE=FILE NAME=
nameACCEPT=
mime type list>
The file type input tag allows the user to attach one or more files to the form for submission. The NAME attribute is a required field and is used to identify the data for the field. The ACCEPT attribute is a list of mime types that will be accepted. (e.g. "image/*" or "image/gif, image/jpeg").
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<INPUT TYPE=HIDDEN NAME=
nameVALUE=
value>
The hidden type input tag specifies a hard coded name-value pair within the form. This field is not displayed to the user. Both NAME and VALUE are required attributes.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<INPUT TYPE=IMAGE NAME=
nameSRC=
"URL">
<INPUT TYPE=IMAGE NAME=
nameSRC=
"URL"ALIGN=
"alignment">
The image type input tag specifies an image to be presented to the user. As soon as the user clicks on the image, the form is submitted with the selected x y coordinates of the spot on the image and the data for the other form fields. The NAME attribute is a required field and is used to identify the data for the field. The SRC and ALIGN attributes are the same as in the Inline Image tag.
The ALIGN attribute is used for image alignment and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
The 3.0 specification added two new attributes: DISABLED, and ERROR. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field.
<INPUT TYPE=PASSWORD NAME=
name>
name
<INPUT TYPE=PASSWORD NAME=MAXLENGTH=
length>
name
<INPUT TYPE=PASSWORD NAME=SIZE=
size>
name
<INPUT TYPE=PASSWORD NAME=VALUE=
value>
The password type input tag specifies a single line text entry field within the form that contains it. The value entered by the user will be obscured as it is entered. The NAME attribute is a required field and is used to identify the data for the field. The MAXLENGTH attribute specifies the number of characters that can be entered into this field. If MAXLENGTH is not specified then there is no limit on the number of characters entered. If MAXLENGTH is longer than SIZE then the text field will scroll appropriately. The SIZE attribute specifies the amount of display space this field should take up. The default for SIZE will vary by browser. The VALUE attribute specifies the initial value of the field.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT..
<INPUT TYPE=RADIO NAME=
nameVALUE=
value>
name
<INPUT TYPE=RADIO NAME=VALUE=
valueCHECKED>
The radio button type input tag allows a choice among a number of options. Normally more than one radio button will appear in the form with the same name. The user can then select only one of the of the choices. The NAME attribute is a required field and is used to identify the data for the field. If one of the choices has the CHECKED attribute it will initially be selected. If none of the choices has the CHECKED attribute then the first one defaults as initially selected. The VALUE attribute specifies the value that is returned if the box is checked.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
Support: | 3.0 |
<INPUT TYPE=RANGE NAME=
nameMIN=
minMAX=
max>
name
<INPUT TYPE=RANGE NAME=MIN=
min> MAX=
maxVALUE=
value>
The range type input tag allows the user to enter an number restricted to a set range. The NAME attribute is a required field and is used to identify the data for the field. The MIN and MAX attributes specify the minimum and maximum values that can be entered. If either MIN or MAX is a real number then the user can enter real numbers, otherwise only integers can be entered. The VALUE attribute specifies an initial value and should be in the range specified.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<INPUT TYPE=RESET>
The reset type input tag specifies a button. When the user clicks the button, all the fields in the form are reset to their initial values.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
Support: | 3.0 |
<INPUT TYPE=SCRIBBLE NAME=
nameSRC=
URLVALUE=
text>
The scribble type input tag allows the user draw on a predefined image. The NAME attribute is a required field and is used to identify the data for the field. The SRC
attribute specifies the
URL of the image. The VALUE
attribute specifies a text string that is used as an alternate if images or scribbling are not supported by the browser.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<INPUT TYPE=SUBMIT>
name
<INPUT TYPE=SUBMIT NAME=>
value
<INPUT TYPE=SUBMIT VALUE=>
The submit type input tag specifies a button. When the user clicks the button, the form is submitted. The NAME attribute is used to identify the data for the field. If no NAME attribute is given then this element does not form part of the submitted response. The VALUE attribute specifies the label for the button.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<INPUT TYPE=TEXT NAME=
name>
name
<INPUT TYPE=TEXT NAME=MAXLENGTH=
length>
name
<INPUT TYPE=TEXT NAME=SIZE=
size>
name
<INPUT TYPE=TEXT NAME=VALUE=
value>
The text type input tag specifies a single line text entry field within the form that contains it. The NAME attribute is a required field and is used to identify the data for the field. The MAXLENGTH attribute specifies the number of characters that can be entered into this field. If MAXLENGTH is not specified then there is no limit on the number of characters entered. If MAXLENGTH is longer than SIZE then the text field will scroll appropriately. The SIZE attribute specifies the amount of display space this field should take up. The default for SIZE will vary by browser. The VALUE attribute specifies the initial value of the field.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<SELECT NAME=
name>
option entries</SELECT>
name
<SELECT NAME=MULTIPLE>
option entries</SELECT>
name
<SELECT NAME=SIZE=
size>
option entries</SELECT>
name
<SELECT NAME=SRC=
URLWIDTH=
widthHEIGHT=
heightUNITS=
units>
option entries</SELECT>
content
<OPTION>content
<OPTION SELECTED>value
<OPTION VALUE=>
contentshape
<OPTION SHAPE=>
The select tag specifies a multiple line selection box field within the form that contains it. The user can select one or more lines if the attribute MULTIPLE is specified. The NAME attribute is
a required field and is used to identify the data for the field. The SIZE attribute specifies the number of lines of selections that are to be displayed.
The SELECTED attribute of the option tag specifies that the option is to be initially selected. The VALUE attribute specifies the value to be returned if this option is selected. If the VALUE
attribute is not specified the content of the option is used.
The select tag's SRC, WIDTH, HEIGHT, and UNITS attributes and the option tag's SHAPE attribute define an image map. These attributes are the same as the ones described in the Figure tag.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.
<TEXTAREA NAME=
nameCOLS=
# columnsROWS=
# rows>
content</TEXTAREA>
name
<TEXTAREA NAME=COLS=
# columnsROWS=
# rowsWRAP
=type>
content</TEXTAREA>
The text area tag specifies a multiple line text area field within the form that contains it. The NAME attribute is a required field and is used to identify the data for the field. The COLS
attribute specifies the width in characters of the text area. The ROWS attribute specifies the number of lines the text area contains. The content is used as an initial value for the field. The
field can be scrolled beyond the COLS and ROWS size to allow for larger amounts of text to be entered. The wrap attribute can have values of OFF
, SOFT
and HARD
.
The 3.0 specification adds three new attributes: DISABLED, ERROR, and ALIGN. The DISABLED attribute shows the field but will not allow the user to modify it. The ERROR attribute is used to supply an error message for the field. The ALIGN attribute is used to position the field and can be one of TOP, BOTTOM, MIDDLE, LEFT or RIGHT.