Monday, 15 April 2013

Bootstrap Sign Form Example - "required" attribute -



Bootstrap Sign Form Example - "required" attribute -

the "signin" illustration html form comes bootstrap examples has "required" attribute 2 form fields on sign in form:

<input type="email" class="form-control" placeholder="email address" required autofocus> <input type="password" class="form-control" placeholder="password" required>

from can tell doesn't create these fields mandatory - can still submit form in illustration if both fields empty.

can explain "required" attribute , how works? presume need utilize validation plugin/javascript create these fields mandatory before form can submitted?

the required attribute html5 form attribute used input controls within form. using required attribute create sure on form submit required field filled in otherwise validation error shown browser.

you can seek this link in various browsers , see message when no input value given.

fyi, required attribute of input tag not supported in net explorer 9 , before versions, or in safari. don't need utilize special validation plugins that. part of html5 new attributes , automatically fired supported browsers when form submitted.

<form action=""> username: <input type="text" name="usrname" required> <input type="submit"> </form>

twitter-bootstrap

No comments:

Post a Comment