Jquery. Validate Chinese API and application example (2) simple verification-rule application

Source: Internet
Author: User

Jquery. Validate API: jquery_validateapi .rar

Deep Learning about jquery. validatejquery. Validate Chinese API and application example (3) advanced verification Basics

1. Rules for using class verification:

In the class, you can use: required, email, number, URL, date, dateiso, datede, digits, creditcard, and phoneus.

Attributes can be added: minlength, maxlength, Min, Max, accept, and remote (Note: Check whether the returned result is bool or XML). Allow to = '# password'

No built-in methods for use are found: required (dependency-expression), required (dependency-callback), range, rangelength

2. Rules for JSON object verification:

Define the following definition in class: class = "{validate: {required: True, minlength: 6, messages: {required: 'Enter the password', minlength: 'The password is too short, at least 6 digits '}}}"

We can still define number: True, email: True, URL: True, Date: True, dateiso: True, datede: True, digits: True, creditcard: True, phoneus: True

Min: 3, Max: 10, minlength: 3, maxlength: 10, required: '# Other: checked' [The expression function here is required (dependency-expression )]

Compared with the class, we can use the range method. It can be defined as a number range: [3, 10], the string length rangelength: [3, 10], remote: URL, accept: '.csv |. JPG |. doc |. docx', pointer to: '# password'

No built-in method for use found: required (dependency-callback)

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.