In order to group input elements and submit data, HTML uses a form element to encapsulate input and submission elements. These forms handle sending the data in the specified method to a page handled by a server or handler. This topic explains and demonstrates the usage of HTML forms in collecting and submitting input data.
<form method="post|get" action="/?originalUrl=https%3A%2F%2Friptutorial.com%2F%26quot%3BsomePage.php%26quot%3B%2520target%3D%26quot%3B_blank%7C_self%7C_parent%7C_top%7Cframename%26quot%3B%26gt%3B%253C%2Fcode">| Attribute | Description |
|---|---|
accept-charset | Specifies the character encodings that are to be used for the form submission. |
action | Specifies where to send the form-data when a form is submitted. |
autocomplete | Specifies whether a form should have autocomplete on or off. |
enctype | Specifies how the form-data should be encoded when submitting it to the server (only for method="post"). |
method | Specifies the HTTP method to use when sending form-data (POST or GET). |
name | Specifies the name of a form. |
novalidate | Specifies that the form should not be validated when submitted. |
target | Specifies where to display the response that is received after submitting the form. |
The <form> element represents a section that contains form-associated elements (e.g. <button> <fieldset> <input> <label> <output> <select> <textarea>) that submits information to a server. Both starting (<form>) and ending (</form>) tags are required.