How to validate groups with jquery validate plugin

Source: Internet
Author: User
How does jquery validate implement group verification?
The requirements for group verification are also quite common. For example, each step is verified by multiple steps. After the verification is passed, the next step is entered.

VaR isvalid = true;
VaR $ step = $ ("# Step1 ");
$ Step. Find (": Input"). Each (function (I, item ){
If (! $ (Item). Valid () {// jquery validate provides the valid method for us to verify specific elements
Isvalid = false;
}
});

If (isvalid ){
Alert ("success ");
} Else {
Alert ("wrong ");
}

Here we mention that in webform, we often put multiple <asp: button/> buttons in a form, such as submit and back.
<Asp: button/> all buttons belong to type = "Submit", so verification is triggered.
We do not want to trigger verification for the back button. <asp: button id = "btnback" runat = "server" text = "back" cssclass = "cancel"/>, we only need to add the cancel class to get jquery. validate is filtered out.

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.