forms - jquery validation only validates first field - others are ignored -
i'm using jquery validation plugin should validate inputs in form, stops @ first one. if click on second input , leave blank - ok - validates...
otherwise - not...
i found of same answers - no success...
here's fiddle example wrote
// // jquery validate example script // // prepared david cochran // // free use -- no warranties, no guarantees! // $(document).ready(function(){ // validate // http://bassistance.de/jquery-plugins/jquery-plugin-validation/ // http://docs.jquery.com/plugins/validation/ // http://docs.jquery.com/plugins/validation/validate#toptions $('.validate').validate({ highlight: function(element) { $(element).parent().removeclass('has-success').addclass('has-error'); }, success: function(element) { element.closest().removeclass('has-error').addclass('has-success'); } }); }); // end document.ready`enter code here`
using:
- bootstrap
- jquery
- jquery validation
use name
fields instead of id
<div class="form-group"> <label class="control-label" for="login_id">login id:</label> <input type="text" class="form-control required" name="login_id"> </div> <div class="form-group"> <label class="control-label" for="password">password:</label> <input type="password" class="form-control required" name="password"> <div class="forgot"> <a href="#"> forgot password? </a> </div> </div>
demo: fiddle
Comments
Post a Comment