lets assume i have 2 button in form say button btnA and btnB.I want to validate my form using validate.js
I try:
var v = $("#form1").validate({
ignore: ':hidden',
rules: {
if(--btnA is clicked--){
txtMenuName: { required: true }
}
if(--btnB--){
txtLinkTitle: { required: true },
txtExternalLink: { required: true }
}
},
messages: {
txtMenuName: "*",
review: "*",
txtLinkTitle: "*",
txtExternalLink: "*"
}
});
But i am unable to catch which button is click.Plz help to solve my problem.