Home  >  Article  >  Web Front-end  >  jquery built-in validation (validate) usage example (form validation)_jquery

jquery built-in validation (validate) usage example (form validation)_jquery

WBOY
WBOYOriginal
2016-05-16 17:10:551212browse

(1)required:true required field
(2)remote:"check.php" Use the ajax method to call check.php to verify the input value
(3)email:true The correct format of the email must be entered Email
(4)url:true The URL in the correct format must be entered
(5)date:true The date in the correct format must be entered
(6)dateISO:true The date in the correct format (ISO) must be entered, For example: 2009-06-23, 1998/01/22 Only the format is verified, the validity is not verified
(7)number:true must enter legal numbers (negative numbers, decimals)
(8)digits:true required Enter an integer
(9)creditcard: You must enter a legal credit card number
(10)equalTo:"#field" The input value must be the same as #field
(11)accept: Enter a character with a legal suffix String (suffix of uploaded file)
(12)maxlength:5 Enter a string with a maximum length of 5 (Chinese characters count as one character)
(13)minlength:10 Enter a string with a minimum length of 10 (Chinese characters count as one character) One character)
(14)rangelength:[5,10] The input length must be a string between 5 and 10") (Chinese characters count as one character)
(15)range:[5,10] The input value must be between 5 and 10
(16)max:5 The input value cannot be greater than 5
(17)min:10 The input value cannot be less than 10

Instance Demo:

Copy code The code is as follows:




Usage of validate.js built-in validation rules



< ;body>