This article introduces the jquery Validate form Verification plug-in, add Class attribute form of verification, share for everyone to reference, the specific content as follows
The effect is as follows:
First, jquery form verification plug-in, add Class attribute form of checksum
Second, the default rules
default checksum rule:
- (1) Required:true must be lost field
- (2) Remote: "check.php" use Ajax method to invoke check.php validate input value
- (3) Email:true must enter the correct format email
- (4) Url:true must enter the URL in the correct format
- (5) Date:true must enter the correct format of the date and date check IE6 error, use caution
- (6) Dateiso:true must enter the correct format of the date (ISO), for example: 2009-06-23, 1998/01/22 only verify the format, do not verify the validity
- (7) Number:true must enter a valid number (negative, decimal)
- (8) Digits:true must enter an integer
- (9) CreditCard: Must enter the legal credit card number
- (a) Equalto: "#field" input value must be the same as #field
- (one) Accept: Enter a string with a valid suffix name (the suffix of the uploaded file)
- (Maxlength:5) A string with a maximum of 5 input length (Chinese characters are counted as one character)
- (Minlength:10) A string with a minimum input length of 10 (Chinese characters are counted as one character)
- (rangelength:[5,10] Enter a string that must be between 5 and 10) (Chinese characters are counted as one character)
- () range:[5,10] The input value must be between 5 and 10
- () Max:5 input value cannot be greater than 5
- (min:10) input value cannot be less than 10
Default prompt:
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 (I SO). ", Datede:" Bitte geben Sie ein G eyebrow ltiges Datum. ", Number:" Please enter a ein number. ", valid:" Numberde bitte N Sie eine Nummer ein. ", Digits:" Please enter only digits ", CreditCard:" Please enter a valid credit card number. "And EQ Ualto: "Please enter the same value again.", Accept: "To enter a value with a valid extension.", MaxLength: $.valida Tor.format ("Please enter no further than {0} characters."), MinLength: $.validator.format ("Please enter at least {0} charact ERs. "), Rangelength: $.validator.format (" Please enter a value between {0} and {1} characters long. "), Range: $.validator . Format ("Please enter a value between {0} and {1}."), Max: $.validator.format ("Please enter a value less than or equal to {0}. "), min: $.validatOr.format ("Please enter a value greater than or equal to {0}.")},
This article has been organized into the "jquery form verification Encyclopedia," Welcome to learn to read.
The above is the entire content of this article, I hope to help you learn.