HTML form tag is used to add a form to your website and get user input data. A user input data can be name, email and the query message from the user. This is useful when you want to make a community for your blog or website. A community of users is very helpful for your blog when you want visitors to your website.
A community of active users increase search traffic for your blog. You can add newsletter to your blog using a form to get email id of user. After you get email, you can fire a blog posts daily to your subcriber. By doing this, you can increase your returning visitors.
HTML Form tag Syntax
The simple syntax to put forms inside HTML is given below:
<form action="action url here" method="get|post">
Put other form elements here...
This is the example for attribute enctype, you can use this example to upload form data in format of files.
<title>HTML Form tag example to upload files</title>
<form action="script url" method="get|post" enctype="mutlipart/form-data">
<input type="file" name="myfile" id="fileupload"/>
List of HTML form tag attributes
|Sr. No.||form atribute options||Description|
|1||action||action URL contains the location of the script file that handles the form data.|
|2||method||An HTTP method GET and POST can be used when submitting the form data.|
|3||target||The target attribute ise used when you want visitors to run the script in the new or same window. The values of this attribute are _blank, _self, _parent, _top.|
|4||enctype||enctype attribute is used when you want to upload files like image, doc etc. Use valus mutlipart/form-data. for this.|
List of HTML form tag
|1||<Input>||Define input control inside the form. This is of various types like text, email, checkbox etc. Checkout HTML input tag for more details.||3||<button>||A clickable button can be define using this tag. Checkout HTML button tag to learn more about this.|
|4||<option>||HTML option tag is used to show selectable options.|
|5||<label>||When you want to show labels for form elements, you use HTML label tag.|
|6||<textarea>||To get message from users, a multiline input text is required. Use HTML textarea tag to to do this.|