JQuery Validation
focusInvalid Option
Focus the last active or first invalid element on submit via validator.focusInvalid(). The last active element is the one that had focus when the form was submitted, avoiding to steal its focus. If there was no element focused, the first one in the form gets it, unless this option is turned off.
Syntax
var options; // Type: jQuery.validator.options 
var instance; // Type: jQuery.validator
instance = jQuery(".selector").validate(options);

var value; // Type: boolean 

// Get value
value = instance.focusInvalid;
// Set value
instance.focusInvalid = value;
var focusInvalid : boolean;
Browser Compatibility
8
5
5
See Also

Reference

options type
validate jQuery Plugin

 

 


© 2013 All Rights Reserved.

Send comments on this topic.