Simple validation plug-in based on jquery simpleValidate _ jquery

Source: Internet
Author: User
SimpleValidate is a simple verification plug-in. Based on JQuery, it can be compatible with various browsers after small bugs are modified. The self-used version is provided for download. If you do not need to perform real-time verification of onfocus and onblur, if you do not want to define verification rules for each table through JS, if you only need to perform verification and feedback at the time of submission, if you prefer a simple code structure, I think simpleValidate is a good choice.

According to the attention and downloads, this plug-in is not very popular, but it doesn't matter. It is my dish.
At the bottom, the open-source DEMO is very detailed and easy to use.
The original version does not support IE because the comma and length of JSON are reserved words. The solution is to delete unnecessary commas before "}", and change the variable length to another variable name, I changed one and made the prompt content in Chinese. It is currently in use and no other bugs have been found: jquery. simple. validation. js

Define the data-rules attribute:
Identify multiple verification rules by using the "#", use the plus sign "+" with the verification comparison value, and use the horizontal bar "-" with feedback on the project title. Below are some basic statements:

The Code is as follows:





Define all forms for verification before submission:

The Code is as follows:


$ ('Form'). bind ('submit ', function (){
Var message = $ (this). validate ();
If (message! = True ){
Alert (message );
Return false;
}
Return true;
});

Open Source Address: https://github.com/capucinno-lee/jquery-simple-validation
DEMO address: http://demo.jb51.net/js/2014/jquery_simple_validation/

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.