JQuery Form Verification plug-in EasyValidator Usage Analysis _ jquery

Source: Internet
Author: User
This article mainly introduces the usage of the JQuery Form Verification plug-in EasyValidator. It systematically analyzes the features and usage of EasyValidator as an example, and is a very practical jQuery plug-in, for more information about how to use the JQuery Form Verification plug-in EasyValidator, see the following example. Share it with you for your reference. The details are as follows:

The purpose of this plug-in is: you do not need to write a line of JS verification code, you only need to add the corresponding verification attribute to the form to be verified, so that the verification function is easy to maintain and scalable, it is easier to get started.

The DEMO contains common regular expressions that can be reused directly. To consider scalability, you can write regular expressions for different users.

Functions implemented by EasyValidator:

1. Prompt function (tip = "Text to be prompted" is added to the form or other labels ")

For example:

The Code is as follows:

Or

The Code is as follows:

If you have any questions, please feel free to ask here.

2. Common form verification (add reg = "Regular Expression" to the form ")
For example:

The Code is as follows:


Common form verification DEMO: http://easyvalidator.googlecode.com/svn/trunk/index.html

3. AJAX form verification (add url = "verify system address" to the form ")
For example:

The Code is as follows:


AJAX verification DEMO: There is no online demonstration. Run ajax_demo.html on the terminal to request a remote php file. Of course, it can be JSP or ASP. Here I have preset some existing data in the program. You can refer to it for reference.

4. Common form verification + AJAX form verification (AJAX verification is performed after normal verification is passed)
For example:

The Code is as follows:

5. Extended Function Form Verification (some special business needs ):

These special requirements are based on the business. The following situations are listed:

1. Check the number of checkbox selection boxes. For example, you can select at least one checkbox for a maximum of five checkboxes.
2. Compare multiple forms. For example, the start time form must be smaller than or equal to the end time form, or the two password forms must be equal for registration.

Because of the special nature of this situation, you have to write your own business logic code. The official extendsValidate Extension function is provided to write your own logic code.

Extended Function Form Verification DEMO: http://easyvalidator.googlecode.com/svn/trunk/extends_demo.html

BUG fix log:
: Fixed the BUG of multiple FORM submissions on the same page.
: Added the bgiframe plug-in. Fixed that the SELECT form cannot be masked by the TIP in IE6.
: Added extended APIs and reconstructed core Libraries

2011-1-1: Separate the Form Verification TIP to make the TIP, URL, and REG stand out separately, making them more flexible!

: Modified the ajax tip Error Correction BUG, logical modification, and set the remote code validate_user.php of the AJAX request to GB2312.

Http://code.google.com/p/easyvalidator/downloads/list

Or click here to download. Http://www.jb51.net/jiaoben/32303.html

Online Regular Expression validators: http://regexpal.com/

I hope this article will help you with web programming.

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.