I have 4 buttons on my form, a Submit, Cancel, Add and Remove button. All are working as expected but I would like to disable the Add button until the input field validates.
I've used the validation plugin before but I can't remember all the details. I'm pretty sure it's something like this:
$(function() {
$('#myForm').validate(
rules: {
'elementToWatch': {
success: function(element) {
if($("#myform").validate().element("#myselect")) {
$('#chargeamtaddButton:disabled').removeAttr('disabled');
} else {
$('#chargeamtaddButton').attr('disabled','disabled');
}
},
// etc...
},
// etc...
},
// etc...
});
});
Since there are so many ways to use the validation plugin, it's hard to give you perfect advice but I hope what I've shown gives you a better idea of how to move forward. Maybe if you gave some more code and HTML, I could help you out more.