HTML 5 forms / no javascript needed any more - HTML5 Form
Posted by : larrybek on Oct 07, 2011
Hello there. Today I will speak a little about html 5 forms. I promise you will want to make your own forms after you've read this article.
Each section of the form will be contained within its own fieldset. In the case of the radio buttons for choosing the card type, we will enclose those options in another nested fieldset.
So here's the markup we are going to be working with:
If you noticed there is no need for javascript to check if the fields are filled correctly. It all included in htlm5. Here is the code for form:
<form>
<fieldset>
<legend>Your details</legend>
<ol>
<li>
<label for=name>Name</label>
<input id=name name=name type=text placeholder="First and last name" required autofocus>
</li>
<li>
<label for=email>Email</label>
<input id=email name=email type=email placeholder="example@domain.com" required>
</li>
<li>
<label for=phone>Phone</label>
<input id=phone name=phone type=tel placeholder="Eg. +447500000000" required>
</li>
</ol>
</fieldset>
<input type=submit id=press>
</form>
So its very easy and very fast. I hope my tutorial will help you allot !!! Be connected

no comment
Add comment