JQuery. Validate form verification-Description

Source: Internet
Author: User

Let me explain the keywords and meanings of the validation form. JQuery. validate comes with: 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 }. Between strings "), 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}") custom validation function. You cannot enter Chinese characters // customize the verification numbers and letters jQuery. validator. addMethod ("chrnum", function (value, element) {var chrnum =/^ ([a-zA-Z0-9] +) $/; return this. optional (element) | (chrnum. test (value) ;}, "only numbers and letters can be entered (A-Z, a-z, 0-9)"); usage: EnglishName: {validChar: true, required: true, chrnum: true, maxlength: 50}. You can use regular expressions to customize verification rules. This can be viewed by new users.

Related Article

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.