jQuery.validator.methods

jQuery.validator.methods

Object holding all validation methods known to the validator. This can be accessed to override individual methods, while keeping the default messages.

Examples

Sets a custom email pattern for the built-in email validation rule.

$.validator.methods.email = function( value, element ) {
  return this.optional( element ) || /[a-z]+@[a-z]+\.[a-z]+/.test( value );
}