Form validation
class= ' Required number ' class= ' required number ' /> <br/><span></span></div> ' );
When input is dynamic, you can use class= ' required ', but messages is still in English, if you want to change the content of messages, you can add it in the JS code:
Jquery.extend (jQuery.validator.messages, { required: "Required field", Remote: "Please fix this field", Email: "Please enter the correct format of e-mail", url: " Please enter a valid URL ", Date:" Please enter a valid date ", Dateiso:" Please enter a valid date (ISO). ", Number:" Please enter a valid digit ", digits:" Enter only Integer ", CreditCard:" Please enter a valid credit card number ", Equalto: "Please enter the same value again", Accept: "Please enter a string with a valid suffix name", Maxlength:jQuery.validator.format ("Enter a string of up to {0}"), MinLength: JQuery.validator.format ("Please enter a string with a minimum length of {0}"), Rangelength:jQuery.validator.format ("Enter a string between {0} and {1}"), Range:jQuery.validator.format ("Please enter a value between {0} and {1}"), Max:jQuery.validator.format ("Enter a value up to {0}"), min: JQuery.validator.format ("Please enter a value of minimum {0}")});
Recommended practice, put this file into messages_cn.js and introduce it in the page:
<script src= ". /js/messages_cn.js "type=" Text/javascript "></script>
This allows you to change the error message you want in messages_cn.js.
JQuery Validate input is dynamically changing