Name
<form> — NN: 2, 3, 4 • MSIE: 2, 3, 4, 5 • HTML 4 • WebTV • Opera3
Synopsis
<form> ... </form>
Indicates the beginning and end of a form. There can be more than one form in an HTML document; however, forms cannot be nested and it is important that they do not overlap.
Attributes
action=
url
Specifies the URL of the application that will process the form (required). This is most often a pointer to a CGI script on the server. The default is the current URL.
enctype=
encoding
Specifies how the values for the form controls are encoded when they are submitted to the server. The default is the Internet Media Type (
application/x-www-form-urlencoded
). The valuemulti-part/form-data
should be used in combination with the file input element.method=get|post
Specifies which HTTP method will be used to submit the form data (required). With
get
(the default), the information is appended to and sent along with the URL itself. Thepost
method puts the form information in a separate part of the body of the HTTP request.post
is the preferred method according to the W3C specification.
HTML 4.0 Specification attributes
accept=content-type-list
Specifies a comma-separated list of file types (MIME types) the server will accept and is able to process. Browsers may one day be able to filter out unacceptable files when prompting a user to upload files to the server.
accept-charset=
charset list
Specifies the list of character encodings (i.e.,
iso-8859-1
) for input data that must be accepted by ...
Get HTML Pocket Reference now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.