XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / form
(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
form
HTML 4.01 | HTML 5 |
<form> ... </form>
Identifies an interactive form containing controls to collect user input and other page content. A document can contain multiple forms, but forms must not be nested or overlap.
Start/end tag
Required/required
Attributes
Core, Internationalization, events; also onsubmit, onblur, onreset
Global HTML 5 attributes
accept="Liste möglicher Inhaltstypen"Not available in HTML 5. A comma-separated list of file types (MIME types) accepted and processed by the server. Browsers may one day filter out unacceptable files when users are asked to upload files to the server. However, this attribute is rarely supported.
accept-charset="Liste mit Zeichenkodierungen"Contains a list of input character encodings the server must accept to process this form. The value is a comma- or space-separated list of ISO character set names. The default is
unknown(unknown). This attribute is rarely supported.action="URL"Required. Specifies the URL of the application processing the form. The default is the current URL.
autocomplete="on|off"HTML 5 only. Allows the user agent (browser) to fill a field automatically (
on) or require user input each time (off). If this attribute is absent, the control inherits the settings forautocompletefrom the surroundingformelement.enctype="Inhaltstyp"Specifies how control values are encoded when sent to the server using the HTTP method POST, defined by the attribute
method. The default is the Internet media type (application/x-www-form-urlencoded). If the input elementfileis used, the valuemultipart/form-datashould be used.method="get|post"Specifies the HTTP method for submitting form data. The value
get(the default) appends data to the URL and sends both to the server.name="Text"Deprecated in XHTML 1.0; use instead
id. Assigns a name to the form.novalidate(novalidate="novalidate"in XHTML)HTML 5 only. Specifies whether to validate the form on submission.
target="Name"Specifies the window or frame in which to display the processed form’s results. Besides a name, one of the keywords
_bottom,_top,_parentor_selfcan be used.
Example
<form action="/cgi-bin/guestbook.pl" method="get">
<p>Vorname: <input type="text" name="vorname"></p>
<p>Nachname: <input type="text" name="nachname"></p>
<p><input type="submit" /> <input type="reset"></p>
</form>
|
Copyright © 2010 O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from "HTML & XHTML ─ kurz & gut" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de