HTML <form> tag
<form> - </form>
Definition and Usage
tag acts as a container for controls.
- The layout of the form (given by the contents of the element).
- The program that will handle the completed and submitted form (the action
attribute). The receiving program must be able to parse name/value pairs in
order to make use of them.
- The method by which user data will be sent to the server (the method
- A character encoding that must be accepted by the server in order to
handle this form (the accept-charset
attribute). User agents may advise the user of the value of the accept-charset
attribute and/or restrict the user's ability to enter unrecognized
A form can contain text and markup (paragraphs, lists, etc.) in addition to form
||An URL, a CGI script or JAVA servlet that defines where
to send the data when the submit button is pushed
||list of contenttypes
||This attribute specifies a comma-separated list of
content types that a server processing this form will handle correctly.
User agents may use this information to filter out non-conforming files
when prompting a user to select files to be sent to the server
||A comma separated list of possible character sets for the
form data. The default value is "unknown"
||The mime type used to encode the content of the form
|This attribute specifies which HTTP method will be used
to submit the form data set
get: With the HTTP "get" method, the form data set is appended
to the URI specified by the action attribute
(with a question-mark ("?") as separator) and this new URI is
sent to the processing agent.
post: With the HTTP "post" method, the form data set
is included in the body of the form and sent to the processing agent.
||Defines a unique name for the form
Defines the location of the target URI.
- _blank renders the response in a new, unnamed window
- _self renders the response in the current frame
- _parent renders the response in the immediate frameset parent
- _top renders the response in the full, unframed window
|id, class, title, style, dir, lang, xml:lang
For a full description, go to Standard
|onsubmit, onreset, onclick, ondblclick, onmousedown,
onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown,
For a full description, go to Event Attributes.
<form action="test.htm" method="GET"
<p><input type="text" name="email" size="10" value="email@">
<input type="submit" value="Subscribe" name="B1"></p>