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. |
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.
Submitting
The Action Attribute
The action attribute defines the action to be performed when the form is submitted, which usually leads to a script
that collects the information submitted and works with it. if you leave it blank, it will send it to the same file
Target attribute in form tag
The target attribute specifies a name or a keyword that indicates where to display the response that is received
after submitting the form.
The target attribute defines a name of, or keyword for, a browsing context (e.g. tab, window, or inline frame).
From Tag with a target attribute:
Grouping a few input fields
While designing a form, you might like to group a few input fields into a group to help organise the form layout.
This can be done by using the tag . Here is an example for using it.
For each fieldset, you can set a legend for the set using the tag LEGEND TEXT
Example
Result
Browser Support
Chrome, IE, Edge, FireFox, Safari and Opera’s latest versions also supports the tag