Refer to the jquery validation plugin's demo learning
Page Introduction jquery.js and Jquery.validate.js can;
<script src= ". /lib/jquery.js "></script>
<script src= ". /dist/jquery.validate.js "></script>
The language pack is introduced because the prompt information in the validation is in English
<script src= ". /dist/localization/messages_zh.js "></script>
The contents are as follows
(function (Factory) {
if (typeof define = = = "function" && define.amd) {
define (["jquery", ".. /jquery.validate "], factory);
} else if (typeof module = = = = "Object" && module.exports) {
Module.exports = Factory (Require ("jquery"));
} else {
Factory (JQuery);
}
} (function ($) {
/*
* Translated default messages for the JQuery validation plugin.
* LOCALE:ZH (Chinese, Chinese (zhōngwén), Chinese, Korean)
*/
$.extend ($.validator.messages, {
Required: "This is a required field",
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 (YYYY-MM-DD)",
Number: "Please enter a valid digit",
Digits: "Only enter Numbers",
CreditCard: "Please enter a valid credit card number",
Equalto: "Your input is not the same",
Extension: "Please enter a valid suffix",
MaxLength: $.validator.format ("You can enter a maximum of {0} characters"),
MinLength: $.validator.format ("minimum input {0} characters"),
Rangelength: $.validator.format ("Please enter a string of length between {0} and {1}"),
Range: $.validator.format ("Please enter a value between {0} and {1}"),
Max: $.validator.format ("Please enter a number not greater than {0}"),
Min: $.validator.format ("Please enter a number not less than {0}")
} );
}));
jquery knowledge too food, temporarily lazy to control the specific meaning, and Validate.js's head is the same.
The following is actually the validate.js in the $.validator of the messages changes, you can see inside the check field is the same, that is, the message is different.
001. Introduction of jquery Validate