The example in this article describes the usage of JQuery form validation plug-in EasyValidator. Share it with everyone for your reference. The details are as follows:
The purpose of this plug-in is: users do not need to write a line of JS verification code, they only need to add the corresponding verification attributes to the form to be verified, making the verification function easy to maintain, scalable, and easier to use.
DEMO already contains commonly used regular expressions, which can be reused directly. In order to consider scalability, you can write your own regular expressions according to the special needs of different users.
Function implemented by EasyValidator:
1. Prompt function (add tip="the text you want to prompt" in the form or other tags)
For example:
or
2. Ordinary form verification (add reg="regular expression" to the form)
For example:
3. AJAX form verification (add url="verification system address" to the form)
For example:
4. Ordinary form verification AJAX form verification (after passing the ordinary verification, perform AJAX verification)
For example:
5. Extended function form validation (some special business needs):
These special needs are based on business. Here are some situations:
1. Verification of the number of checkbox selection boxes, such as limiting others to select at least 1 checkbox and up to 5 checkboxes.
2. Compare multiple forms. For example, the [Start Time Form] must be less than or equal to the [End Time Form] or the two password forms must be equal when used for registration, etc.
Due to the particularity of this situation, users have to write their own business logic code. The official has provided the extendsValidate extension function, and just write their own logic code in it.
Extended function form validation DEMO: http://easyvalidator.googlecode.com/svn/trunk/extends_demo.html
BUG fix log:
2010-9-24: Fix multiple FORM submission bugs on the same page, TIP misplacement bug
2010-9-26: Added bgiframe plug-in to fix the problem that TIP cannot be masked in IE6
2010-9-27: Add extension API and reconstruct core library
2011-1-1 : Separate the TIP of form verification, making TIP, URL, and REG exist as separate components, which is more flexible!
2011-1-28: Modified the AJAX TIP error correction bug, modified the logic, and set the encoding of the remote program validate_user.php of the AJAX request to GB2312.
Official download address: http://code.google.com/p/easyvalidator/downloads/list
Or click here to download from this site. http://www.jb51.net/jiaoben/32303.html
Online regex validator: http://regexpal.com/
I hope this article will be helpful to everyone’s web programming design.