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

Source: Internet
Author: User

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> 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.