Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery validation focus field on error

var validator = $("#test-form").validate({ /* settings */ });

$("#validate").click(function() {
      if ($("#test-form").valid()) 
              alert("Valid!");
      else
            validator.focusInvalid();
      return false;
});
 
PREVIOUS NEXT
Tagged: #jquery #validation #focus #field #error
ADD COMMENT
Topic
Name
9+7 =