Share on Google+Share on Google+

HTML5 form example, How to implement form tag in html document.

In this tutorial, you will see the use of form tag in HTML5.

HTML5 form example, How to implement form tag in html document.

HTML form tag is provides form to user. It support different controls. These controls is input controls, which is use for input user data. A HTML form always starts <form> tag. It is most important for each and every website, because it is use for registration , order, searching etc.
Html form is a pair tag.
Form is a container for containing controls like text, button, checkbox, radio button etc. Form take information from user and process them.

Attributes of form:
Attribute of form tag provides significant information about the form for the browser. There are following attributes..
1- accept-charset
3- autocomplete

Declaration Syntax :

Declaration syntax of form in HTML5.

                           <form attributes> controls</form>

Example of <form> in HTML5:

<!DOCTYPE html >
<head><title>Untitled 1</title></head>
<form name="form1">
<table style="width: 49%">
<caption><strong>Employee registration form</strong></caption>
<tr> <td> <label>EmpName </label>&nbsp;</td>
<td><input type="text" name="text" /></td></tr>
<tr><td><label>EmpId &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; </label></td><td><input type="text" name="Empid" />
</td></tr><tr><td> <label>Age&nbsp;&nbsp;&nbsp; </label>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td><td>
<input type="text" name="age" /></td></tr> <tr>
<td><button type="submit" value="Submit" >Submit</button></td>
<td> <button type="reset" value="Reset">Reset</button>

Download this code

Difference Between HTML5 and HTML4.01:

The form tag is available in both HTML5 and HTML4.01. But there is some attribute in HTML5, that is not supported by HTML4.01.



Posted on: September 18, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.