HTML <form> Tag
<form> HTML element sets the form on the web page. The form is intended for data exchange between the user and the server. The scope of the forms is not limited to sending data to the server, using client scripts you can access any element of the form, change it and apply it as you wish.
A document can contain any number of forms, but only one form can be sent to the server at a time. For this reason, these forms must be independent of each other.
- Permitted Parents
- Any element that accepts flow content
- Block, inline, and text, but not containing <form> elements
- Start/End Tags
- Start tag: required, End tag: required
<form action="" method="post">
First name: <input type="text" name="first_name" /><br />
Last name: <input type="text" name="last_name" /><br />
<input type="submit" value="Submit" />
|accept-charset||Specifies a list of character encodings that the server accepts.|
|action||Specifies a URI/URL of the page that will process the form.|
|autocomplete||Specifies whether a form should have autocomplete on or off|
|enctype||Specifies the content type used to encode the
form data set when it's submitted to the server.
|method||Specifies the HTTP method to use when the form
|name||Assigns a name to the form. This is used when referencing the form with stylesheets or scripts. If there are multiple forms, the name of each form must be unique.|
|novalidate||Specifies that the form should not be validated when submitted|
Specifies where to open the action URL.
<form> tag also supports the Global Attributes in HTML5
<form> tag also supports the Event Attributes in HTML5
|Tablets / Mobile|
Last updated by CSSPortal on: 6th December 2019