Main Index |
Top Of Tree |
Tag Index |
Tag History
- What is it?
- The FORM tags are used to delimit the range of data fields for
a form. These tags also serve 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 tag 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
- Attributes
- Action
- 2
| 3 | 3.2
| IE1 | M2A1
| N1
- Required? No
- 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
| IE1 | M2A1
| N1
- 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
| IE1 | M2A1
| N1
- 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
- Target
- 2
| 3 | 3.2
| IE3A1 | M
| N2
- 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:
The TARGET reserved names apply.
Event Handler Attributes
- [For more information on Event Handlers, please see the
SCRIPT page.]
- onSubmit
- 2
| 3 | 3.2
| IE3B1 | M
| N2B3
- Required? No
- Description:
A submit Event Handler executes Script code when a user submits
a form. It can also be used to prevent a form from being submitted;
to do so, put a return statement that returns false in the
event handler. Any other returned value lets the form submit. If you
omit the return statement, the form is submitted.
- Values:
Script statements or an external function call.
Style Sheet Attributes
[More on Cascading Style Sheets]
- Class
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This represents an assigned semantic classification grouping(s) for the
current tag.
- Values:
Given as a comma separated list of alphanumeric characters. Class names
may contain spaces (multiple consecutive spaces treated as a single
space.)
- ID
- 2 | 3
| 3.2 | IE3B1
| M | N4B2
- Required? No
- Description:
This assigns an alpha-numeric identifier that is unique
to this tag instance. Style sheets may use this attribute to reference
the current instance of this tag. Hyperlinks may also use this identifier
to serve as a destination.
- Values:
An alphanumeric string - initial character must be a letter followed
by alphabetic characters, digits, "-" or "."
characters. The allowable set of alpha-characters is restricted to the
A-Z and a-z set.
- Style
- 2 | 3
| 3.2 | IE3B1
| M | N4B3
- Required? No
- Description:
This attribute is a text string that provides rendering style
information for the current tag.
- Values:
Please see the description of
inline styles for more
information on how to use this attribute and its
possible values.
- 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% |
%Multimedia Parent% |
<body> |
<basefont>
Exceptions:
<form>
- Content Model
- %Text% |
%Anchors% |
%Virtual Formatting% |
%Physical Formatting% |
%Line Break Content% |
%Multimedia Content% |
%Block Content% |
%Form Fields% |
<address> |
<basefont> |
<Hx>
Exceptions:
<form>
Tips & Tricks
- DTD Note: The HTML 3.2 DTD lists
the ACTION attribute as not required whereas the Internet Explorer 3.0
DTD lists it as required. I went with the official stance here even
though it seems more logical to make it REQUIRED.
Browser Peculiarities
Boring Copyright Stuff...