HTML Tag: form
Form, typically used to facilitate the submission of user-inputted data.
Used with elements such as input
, select
and textarea
to create form controls.
Optional Attributes
Attribute | Description | Possible values |
---|---|---|
action |
The address to which submitted form data should be sent to. | URL. |
method |
The HTTP method by which submitted form data should be sent. |
|
enctype |
The MIME type used to encode the form data. |
|
accept-charset |
The character encoding(s) of the submitted data. | A character encoding, such as utf-8 , or several separated by spaces |
autocomplete |
Sets the default autofill of controls in the form. |
|
name |
The unique name of a form, used when a page contains more than one form. | Text. |
novalidate |
Indicates that the form should not be validated before it is submitted. | None. |
target |
The browsing context in which the submitted form’s destination URL should open. |
|
Global attributes |
Example
<form action="someKindOfProcessingScript.php" method="post">
<label for="housenumber">House number</label>
<input name="housenumber" id="housenumber">
<label for="street">Street</label>
<input name="street" id="street">
<input type="submit">
</form>