jquery validate the default validation rules

The default rule checksum

Copy the code
(1), required: true losing field 
(2), remote: "remote -valid.jsp" ajax method call using the remote-valid.jsp validate input values 
(3), email: true must enter the correct e-mail format 
( 4), url: true URL must be entered in the correct format 
(5), date: true date must be entered in the correct format, date validation error ie6, caution 
(6), dateISO: true date must be entered in the correct format (ISO) , for example: 2009-06-23,1998 / 01/22 format verification, does not verify the validity of 
(7), number: true must enter a valid number (negative decimal) 
(. 8), digits: integer must be entered to true 
( 9), creditcard: true must enter a valid credit card number 
(10), equalTo: "# password" and enter the value must be the same #password 
(11), accept: the input string has a legitimate name suffix (suffix uploaded file) 
( 12), maxlength: 5 is the maximum length of the input string. 5 (a kanji character count)  
(13 is), minLength: 10 is the minimum length of the input string 10 (a kanji character count)
(14), rangelength: [5,10] between the length of the input string must be between 5 and 10 ") (Chinese characters count as one character)
(15), range: [5,10 ] must enter a value between 5 and 10 
(16), max: 5 input must not exceed 5 
(. 17), min: 10 input value is not less than 10

Second, the default prompt

Copy the code
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
dateDE: "Bitte geben Sie ein g眉ltiges Datum ein.",
number: "Please enter a valid number.",
numberDE: "Bitte geben Sie eine Nummer ein.",
digits: "Please enter only digits",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
accept: "Please enter a value with a valid extension.",
maxlength: $.validator.format("Please enter no more than {0} characters."),
minLength: $ .validator.format (. "Please Enter characters AT Least {0}"), 
rangelength: $ .validator.format ( "Please Enter BETWEEN A value {0} and {} characters. 1 Long."), 
Range: .validator.format $ ( "Please Enter BETWEEN A value {0} and {}. 1."), 
max: $ .validator.format (. "Within last Please Enter A value less or equal to {0}"), 
min: .validator.format $ ( "Please Enter a Within last value Greater or equal to {0}.") 
} 

the jQuery provides the Validate Chinese information presentation package, the download package located dist / localization / messages_zh.js, just introduced into the package page.
Of course, you can also set up their own messages to set reminders.

Guess you like

Origin www.cnblogs.com/shirleyxuezi/p/12169824.html