Create a form inside a document. A form consists of one or more input-capable
fields. The form can include GUI-elements such as radio-buttons, checkboxes,
buttons and textfields.
Using a form you can send information to the Web-server which will invoke the
supplied program and pass the information to that program. So with forms you
can allow the user to pass data to the server. Forms can be used for things
such as order-entry, supplying search criteria or subscribing to a mailing
The fields of a form are defined using the
The FIELDSET element can group fields within
the form logically.
<!ELEMENT FORM - - (%block;|SCRIPT)+ -(FORM) -- interactive form -->
%attrs; -- %coreattrs, %i18n, %events --
action %URI; #REQUIRED -- server-side form handler --
method (GET|POST) GET -- HTTP method used to submit the form--
enctype %ContentType; "application/x-www-form-urlencoded"
onsubmit %Script; #IMPLIED -- the form was submitted --
onreset %Script; #IMPLIED -- the form was reset --
accept-charset %Charsets; #IMPLIED -- list of supported charsets --
HTML 4.0 DTD,
All Rights Reserved."
This attribute specifies a list of content types, separated by commas, that the
server that handles the form, accepts. A browser can use this information for
INPUT elements with type="file", to select which files may be uploaded.
This attribute specifies a list of character encodings, that the server must be
able to process when the form is submitted. The values in the list may be
space- or comma-delimited.
The default value is "UNKNOWN", a reserved value. The browser handles this as
the same character encoding that is used for the page that contains the FORM.
When the user submits the form the browser will use the value of this attribute
to know where to send the data. This can be the URL of a program that processes
the data, or an email address. For an email address use the format
mailto:email@example.com to send the data to firstname.lastname@example.org.
The mailto: address is not supported by Microsoft's Internet Explorer.
Specifies the MIME type that will be used to encode the form's contents that
will be sent to the server. The default is
Netscape introduced the type
which is used to implement <INPUT type="file">.
This attribute determines which HTTP method will be used to pass the data to
the program. Which method you must use depends on the program that processes
the incoming data.
The data is appended to the URL of the program.
The result is that the data is not passed directly to the program but
made available in an environment variable called QUERY_STRING.
This sends the input information in a data body that is available on stdin
with the data length set in the environment variable CONTENT_LENGTH.
The default method is GET.
The TARGET attribute forces the load of that link into the targeted window.
The value supplied with the attribute must be the same as the name of the
window, and is case-sensitive. You can give a window a name with the
FRAME element. If a window with the supplied
target name does not exists then a new window will be created with that
If you do not specify a target window the current window will be used, or the
target specified with the BASE element.
These names all begin with the underscore character. Any targeted window name
beginning with underscore which is not one of these names, will be ignored.
This target will cause the link to always be loaded in a new blank window.
This window is not named.
This target causes the link to always load in the same window the anchor was
clicked in. This is useful for overriding a globally assigned BASE target.
This target makes the link load in the immediate FRAMESET parent of this
document. This defaults to acting like
_self if the document
has no parent.
This target makes the link load in the full body of the window. This
defaults to acting like
_self if the document is already at the
top. It is useful for breaking out of an arbitrarily deep FRAME nesting.
<FORM method="post" action="_URL_" onreset="alert('The form is reset')">
<TR><TD>Name </TD><TD><INPUT type="text" name="name"></TD></TR>
<TR><TD>E-mail</TD><TD><INPUT type="text" name="email"></TD></TR>
<TR><TD colspan="2">How did you find these pages
<OPTION>Link on another page
<TR><TD colspan="2" align="center"><INPUT type="submit" value="Send values">
<INPUT type="reset" value="Reset form"></TD>
<FORM action="_URL_" enctype="multipart/form-data" onsubmit="alert('Submitting the form')">
Send this file: <INPUT name="userfile" type="file">
<INPUT type="submit" value="Send File">
Please put me on you christmas-card list :
Name <INPUT name="Name">, Email address <INPUT name="Email">
Please put me on you christmas-card list :