I know him already too late, but still want to add to this. A very simple way to set confirmation for send and blur:
$("#MainForm").validate({
onfocusout: function (element) {
if ($(element).valid())
{
$(element).removeClass('input-error').addClass('input-valid');
}
},
invalidHandler: function (event, validator) {
$.each(validator.errorList, function (index, error) {
$(error.element).addClass('input-error');
});
},
showErrors: function () {
}
});
CSS
.input-error {
border-color: #FF1919;
box-shadow: 0px 0px 10px #FF1919;
}
.input-valid {
border-color:#009500;
box-shadow: 0px 0px 10px #009500;
}
Give it a try.
source
share