skip the form validation to specific controls
Hi,
I want to validate my forms when clicking only on submit button. Here is my code.
$(document).ready(function() {
$("#<%=btnSubmit.ClientID %>").click(function(){
$("#form1").validate({
rules: {
<%=txtFirstName.UniqueID %>: {
required: true
},
<%=txtEmail.UniqueID %>: {
required: true,
email:true
}
}, messages: {
<%=txtFirstName.UniqueID %>:{
required: " First Name required"
},
<%=txtEmail.UniqueID %>:{
required: " Email address required",
email: " Please enter a valid email address"
}
}
});
});
});
The problem is it fires the validation to every button in the form. how can I do the validation only for the submit button and skip the validation to other button clicks?
Thank you