The HTML form There’s a pretty diverse opinion on how this should be done exactly, but we’ll make the code flexible enough to handle different markup styles. <form> <fieldset> <legend>Legend Name</legend> <div> <label for="name">Name</label> <input type="text" id="name" name="name"> </div> </fieldset> </form> This is how I markup my forms. Trying to keep it as simple and semantic as possible, but adding the div to make styling easier. Specifying input validation In HTML4 there is no obvious way attach validation rules to an input. A few developers have been somewhat orthodox and added their own “validation” attribute. <input type="text" id="name" name="name" validation=”required email”> ...
Form validation with jQuery from scratch




Read More