Attaching the validator to the form:
$('#your-form-id').validate();
When the Save button of your modal form is clicked, submit the form (the validator will be triggered):
buttons: {
"Save": function() {
$('#your-form-id').submit();
},
Move the submit logic to the validator submitHandler:
$('#your-form-id').validate({
submitHandler: function(form) {
// do stuff
}
});
$('#your-form-id').validate();
When the Save button of your modal form is clicked, submit the form (the validator will be triggered):
buttons: {
"Save": function() {
$('#your-form-id').submit();
},
Move the submit logic to the validator submitHandler:
$('#your-form-id').validate({
submitHandler: function(form) {
// do stuff
}
});