Possible Duplicate:
jQuery Validation – Multiple submit buttons on one asp.net form, different validation groups?
I am using jQuery validation engine plugin and I have two buttons in my content page: one of them is a submit buttton, and the other one is a cancel button.
When I click on the submit button, the form validation fires but when I click on the cancel button, the form validation fires again. I don’t want to fire validation when the cancel button is clicked.
Any idea ?
<form>
<asp:TextBox ID="TextBox1" CssClass="validate[required]" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" CssClass="validate[required]" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="send" />
</form>
<asp:Button ID="Button2" runat="server" Text="cancel" />
This is more of an asp.net question.
You can just add
CausesValidation="False"as an attribute: