Forms are one of the most important section of a HTML document, which contains controls such as text fields, password fields, checkboxes, radio buttons, button etc. It is required to collect different kinds of user inputs, such as name, email address, phone numbers, credit card information etc. We use the <form>
tag to create a HTML form, and it uses various attributs, which are given below-
Attributs | Description |
---|---|
name | It specifies a name, which is used to identify the form (access through DOM: document.forms.name). |
action | It specifies a url, which will tell where to submit the form (default: current page). |
method | It specifies the HTTP method used when sending the data to the server from the web client (default: GET). |
target | It specifies the target of the address or url in the action attribute (default: _self). |
enctype | It specifies the encoding of the submitted data through form (default: url-encoded). |
<table>
<tr><th>Table Heading 1</th><th>Table Heading 2</th></tr>
<tr><td>Data 1</td><td>Data 2</td></tr>
<tr><td>Data 11</td><td>Data 22</td></tr>
</table>
Form contains form elements, which has various types like text fields, checkboxes, radio buttons, submit buttons, and many more.
Text Fields:-
Password Field:-
Radio Buttons:-
Checkboxes:-
File Select box:-
Textarea:-
Select Boxes
Submit and Reset Buttons:-