Form

Support Key: [2|3|3.2|4] [X1|X1.1] [IE1|M2A1|N1|O2.1]
What is it?
Attributes
Tag Example
Parent/Content Model
Tips & Tricks
Browser Peculiarities
= Index DOT Html by Brian Wilson =
Main Index | Element Tree | Element Index | HTML Support History



   Quick Statistics   
End Tag:
   Required
Standards Details:
In all HTML 4.x/XHTML DTDs
XHTML Modules:
Basic Forms, Forms
CSS 'display' Type:
"block"
CSS Mapping:
NA
Default Rendering:
NA
Official Docs:
HTML 4.x, XHTML 1.1
What is it?
The FORM element is used to delimit the range of data fields for a form. This element also serves to contain information on HOW to process the information collected in the form. There can be more than one form in a HTML document but the FORM element can not be nested. An explanation of HOW to process the submitted data is beyond the scope of these documents - please refer to the Forms Overview page for sites that deal with this subject in greater detail.

Two great testing sites to echo form info:
Method=GET:
http://hoohoo.ncsa.uiuc.edu/htbin/query
Method=POST:
http://hoohoo.ncsa.uiuc.edu/htbin-post/post-query

Common Attributes
%Core%
[2|3|3.2|4] [X1|X1.1] [IE3|M|N4B2|O3.5]
%Accessibility%
[2|3|3.2|4] [X1|X1.1] [IE4B1|M|N6|O5]
%Events%
[2|3|3.2|4] [X1|X1.1] [IE3|M|N2|O3]
%Language%
[2|3|3.2|4] [X1|X1.1] [IE4|M|N6B1|O]
%Editing%
[2|3|3.2|4] [X1|X1.1] [IE5.5|M|N|O]

Specific Attributes
Accept
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: Introduced in HTML 4.01. Now in all HTML 4.01/XHTML DTDs
Required? No
Description:
This attribute specifies the MIME types that the form processing server and script should correctly handle. A browser may use this information to filter out non-conforming files when prompting a user to select files to upload.
Values: CDATA. [Comma-separated list of MIME types.]
Accept-charset
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This specifies a list of acceptable language character sets for the form data. No mention is made what should happen if data is submitted that is NOT from any of these sets.
Values: CDATA. [A space and/or comma separated list of language character set encodings.]
Action
[2|3|3.2|4] [X1|X1.1] [IE1|M2A1|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? Yes
Description:
This specifies the action URL that will process the form contents. If this attribute is absent it defaults to the BASE URL of the current document.
Values: CDATA. [Either an absolute or relative URL. All URLs should be URL encoded where required.]
Align
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O4]
Standards Details: NA
Required? No
Description:
This indicates the horizontal alignment of the content in this block element relative to the browser window.
Values: Left [DEFAULT] | Center | Right
Autocomplete
[2|3|3.2|4] [X1|X1.1] [IE5|M|N|O]
Standards Details: NA
Required? No
Description:
This attribute sets the status of the form/form field 'Autocomplete' feature in Internet Explorer 5.0. A value of 'On' indicates Autocomplete is enabled, and 'Off' disables.
Values: On (DEFAULT), Off
Enctype
[2|3|3.2|4] [X1|X1.1] [IE1|M2A1|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This attribute specifies the MIME media type used to encode the name/value pairs for transport to the form processing mechanism, in case the protocol itself does not impose a format.
Values:
   application/x-www-form-urlencoded [DEFAULT]
   multipart/form-data [MIME type used when an INPUT TYPE=FILE field is present]
Height
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O4-6.x]
Standards Details: NA
Required? No
Description:
This attribute explicitly specifies the height of this block element in pixels.
Values: Positive integers.
Method
[2|3|3.2|4] [X1|X1.1] [IE1|M2A1|N1|O2.1]
Standards Details: In all HTML 4.x/XHTML DTDs
Required? No
Description:
This optional attribute specifies a method or protocol for accessing the ACTION URL. A method of GET will gather all form name/value pair information into a query URL that looks like:
   URL?name=value&name=value&name=value
where URL is the URL specified by the ACTION attribute, or the current document URL if no ACTION attribute was specified. In the POST method, the contents of the form are sent in the body of the HTTP request.
Values: GET [DEFAULT] | POST
Name
[2|3|3.2|4] [X1|X1.1] [IE3B1|M|N2|O3]
Standards Details: Introduced in HTML 4.01. Now in all HTML 4.01/XHTML 1.0 DTDs. Dropped in XHTML 1.1 in favor of ID attribute.
Required? No
Description:
This attribute is used to give a unique label to this form group so that it can be referenced and manipulated with scripting code.
Values: CDATA
SDAPref
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: NA
Required? No
Description:
This is an SGML Document Access (SDA) attribute. SDA attributes are designed to transform HTML (and other SGML-based documents) to the ICADD DTD - which is used in creating accessible documents for users with visual disabilities (rendering in Braille, large print, speech synthesis, etc.) The attribute value specifies content to be added BEFORE the original element content (in this case the string "<Para>Form:</Para>") when the SDA document is rendered.
Value: "<Para>Form:</Para>"
SDASuff
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O]
Standards Details: NA
Required? No
Description:
This is an SGML Document Access (SDA) attribute. SDA attributes are designed to transform HTML (and other SGML-based documents) to the ICADD DTD - which is used in creating accessible documents for users with visual disabilities (rendering in Braille, large print, speech synthesis, etc.) The attribute value specifies content to be added AFTER the original element content (in this case the string "<Para>Form End.</Para>") when the SDA document is rendered.
Value: "<Para>Form End.</Para>"
Target
[2|3|3.2|4] [X1|X1.1] [IE3A1|M|N2|O2.1]
Standards Details: In Transitional and Frameset HTML 4.x/XHTML 1.0 DTDs only. Dropped in XHTML 1.1.
Required? No
Description:
This attribute specifies the named frame for the browser to display the form results after the user submits information to a processing script.
Values: CDATA. [The TARGET reserved names apply.]
Width
[2|3|3.2|4] [X1|X1.1] [IE|M|N|O4-6.x]
Standards Details: NA
Required? No
Description:
This attribute explicitly specifies the width of this block element in pixels.
Values: Positive integers.
Example
<form method="get" action="http://hoohoo.ncsa.uiuc.edu/htbin/query" enctype="application/x-www-form-urlencoded">
   <input type="password" name="foo" />
</form>
Parent Model
%Block Parent%
Exceptions: <form>
Content Model
%In-line Content% | %Block Content% | <keygen>
Exceptions: <form>
Tips & Tricks Browser Peculiarities
Boring Copyright Stuff...