example in a .click event of the button.
change the formName to the correct one (in the example is delDataForm)
$("#saveDelZone").click(function() {
//acts as the submission for saving map based charges
var validator = $('#delDataForm').validate({
errorPlacement: function(){
return false; // suppresses error message text
}
});
validator.form();
if (validator.valid()) {
addObj("admr/del_zone/save/",JSON.parse(JSON.stringify($('#delDataForm').serialize())),saveDelZone);
}
})
Add styles of below if you wish to customise them (defaults in admin_20.css) :-
.error{
border-color:red;
}
.valid{
border-color:green;
}