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.
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: A space and/or comma
separated list of language character sets.
Action
2
| 3 | 3.2
| 4 | IE1
| M2A1 | N1
| O2.1
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: An absolute or relative URL
Enctype
2
| 3 | 3.2
| 4 | IE1
| M2A1 | N1
| O2.1
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]
Method
2
| 3 | 3.2
| 4 | IE1
| M2A1 | N1
| O2.1
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 encoded exactly as with the GET method, but the contents
are sent in environment variables in the HTTP transaction.
Values: GET
[DEFAULT] | POST
Name
2 | 3
| 3.2 | 4
| IE3B1 | M
| N2 | O3
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: Alphanumeric characters.
Target
2
| 3 | 3.2
| 4 | IE3A1
| M | N2
| O2.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.
DTD Note: The ACTION attribute has not been required
historically in older HTML DTDs (although it is now in HTML 4.0), but now
that form fields can be used outside of the FORM context, usage of FORM
suggests that some independent action will be taken with submitted information.
Browser Peculiarities
There is some odd behavior with forms and the LAYER/ILAYER elements.
If a LAYER/ILAYER element is nested inside a FORM element,
and any widgets for the form (buttons, text fields, etc) are contained
within the layer, they will not appear/be rendered. If a widget/field is
to show up, the containing FORM element must lie within the
same LAYER/ILAYER element as its widgets/fields.