Validate () method configuration item
Rules define a validation rule
Messages defining the Prompt information
The above two have been introduced.
The hidden attribute in rules is depends only if it matches the condition (return true).
Submithandler passed the validation after running the function, can the guy be that form submission method
Invalidhandler functions that run after an invalid form is submitted
Submithandler:function(form) { console.log (form). Serialize ());//if validation is passed, the output form is serialized}, Invalidhandler:function(event,validator) { console.log ("error number:" + Validator.numberofinvalids ())//Invalid entry, or invalid, output Xu Xiao number}
Invalidhandler can also be triggered by a bound event
$ (' #demoform '). On (' Invalid-form ', (event,validator) { Console.log ("Number of Errors:" + Validator.numberofinvalids ())})
Ignore validation of certain elements
Groups validation of a set of elements, displaying the set of error hints in one place, using errorplacement control to place the wrong information where
(In practice, it seems that login in no matter what to write, error hints are displayed in info, do not know why, so to judge in the following, in fact, directly write Errorplacement can)
OnSubmit whether to validate on commit, default is true, change to False when Invalidhandler still will judge
Onfocusout whether to validate when the focus is acquired
onkeyup whether to verify when tapping the keyboard
Whether the onclick is validated for check or radio when clicked
Focusinvalid if the form is submitted, the form that is not validated (the first one or the unverified form that received the focus before the submission) will get the focus
Focuscleanup if the element that has not been validated is the focus, whether to remove the error prompt
The above six are validation of events triggered by the time node
Errorclass specifying the CSS class name for the error prompt, you can customize the style of the error prompt
VALIDCLASS Specifies the name of the CSS class that is validated (these two can also look at which tag the previous two classes were added to)
Errorelement what tags to use to mark errors
Wrapper what label to use to wrap errorelement up
Errorlabelcontainer put the wrong information in a container
Errorcontainer Show or hide the verification information, you can automatically implement the error message appears, the container properties to display, no error is hidden. This generally can not write, need additional hints can write
These are the error prompt style and display settings
ShowErrors can display the total number of unverified elements that are typically used for custom error presentation information processing
Errorplacement where to put the custom error message, as described above, with group
Success the element to be validated passes the validated action (the following two ways are possible)
Highlight can add effects to elements that do not pass validation
Unhighlight removing the effects of unverified elements, typically used with highlight
These two are mainly for input, the above success is for the hint message label
Selector extension
: blank selects all empty element half-width spaces are empty, full-width spaces are not empty
: Filled selects all elements that are not empty to remove spaces, longer than 0
: Unchecked selects all elements that are not selected for general use in check boxes
Validate plug-in deep learning -03validate () method configuration Items