Usage Analysis of JQuery Form Verification plug-in EasyValidator, jquery. validator
This document describes the usage of the JQuery Form Verification plug-in EasyValidator. 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:
Copy codeThe Code is as follows: <input name = "name" tip = "enter your name ~ ">
Or
Copy codeThe Code is as follows: <a href = "http://wangking717.iteye.com/blog/769021" tip = "to EasyValidator official homepage to" target = "_ blank"> questions can be raised here </a>
2. Common form verification (add reg = "Regular Expression" to the form ")
For example:Copy codeThe Code is as follows: <input name = "username" reg = "regular"/>
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:Copy codeThe Code is as follows: <input name = "username" url = "Address"/>
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:Copy codeThe Code is as follows: <input name = "username" reg = "regular" url = "Address"/>
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.bkjia.com/jiaoben/32303.html
Online Regular Expression validators: http://regexpal.com/
I hope this article will help you with web programming.