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.