JQuery Validate Form validation Plugin-associate fields with the name attribute for verification, change the default prompt information, and write the validation rules to the js Code. Form validation plugin validate
1. Download dependency packages
Network Disk download: https://yunpan.cn/cryvgGGAQ3DSW access password f224
2. Add another plug-inJquery. validate. messages_cn. Js.
Change the default prompt mode.
/** Translated default messages for the jQuery validation plugin. * Language: CN * Author: Fayland Lam <fayland at gmail dot com> */jQuery. extend (jQuery. validator. messages, {required: "required field", remote: "correct this field", email: "enter an email in the correct format", url: "enter a valid URL", date: "enter a valid date", dateISO: "enter a valid date (ISO ). ", number:" enter a valid number ", digits:" Only an integer can be entered ", creditcard:" enter a valid credit card number ", please: "Enter the same value again", accept: "enter a string with a valid suffix", maxlength: jQuery. format ("enter a string with a maximum length of {0}"), minlength: jQuery. format ("enter a string with at least {0} length"), rangelength: jQuery. format ("enter a string between {0} and {1}"), range: jQuery. format ("enter a value between {0} and {1}"), max: jQuery. format ("enter a maximum value of {0}"), min: jQuery. format ("enter a minimum value of {0 ")});
Iii. jQuery Form Verification plug-in-use the name attribute to associate fields for verification and write validation rules to js Code.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html>