Forms are required to take input from the user who visits the website. This form is used basically for the registration process, logging into your profile on a website or to create your profile on a website, etc …The information that is collected from the form is -1. Name 2.Email Addresses etc. Now the form will take input from the form and post that data in backend applications (like PHP). So the backend application will process the data which is received by them.There are various form elements that we can use like text-fields ,text-area ,drop-down list ,select ,checkboxes ,radio etc ..
<form> Form Content... </form>
Attributes: There are many attributes that are associated with the <form> tag. Some of them are listed below:
- Action Attribute: -This is used to send the data to the server after the submission of the form.
- Method: -This is used to upload the data by using two methods that are Get and Post . Get Method: -It has a limited length of characters of URL. -we should not use get to send some sensitive data. -This method is better for nonsecure data. Post Method: -1. It has no size limitations 2. The submission of the form with the method post, can not be bookmarked.
- Enctype attribute: -This attribute is used to specify that how a browser decodes the data before it sends it to the server .so the values of this attribute are: -1.application/x-www-form-urlencoded − It is the standard method most forms used 2.multipart/form-data -it is used when you have something to upload like files of images, word files, etc.
Example of the form tag:-
The output of the code:-
Supported Browsers: The browser supported by <form> tag are listed below:
- Google Chrome
- Internet Explorer