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=urlSpecifies 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=encodingSpecifies 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-datashould be used in combination with the file input element.method=get|postSpecifies 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. Thepostmethod puts the form information in a separate part of the body of the HTTP request.postis the preferred method according to the W3C specification.
HTML 4.0 Specification attributes
accept=content-type-listSpecifies 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 listSpecifies the list of character encodings (i.e.,
iso-8859-1) for input data that must be accepted by ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access