I have a form with two input textboxes, and I have included jQuery validation rules for both:
Found the answer, you have to provide an unhighlight property as well.
Adds the error class to both the invalid element and its label
$(".selector").validate({
highlight: function(element, errorClass) {
$(element).addClass(errorClass);
$(element.form).find("label[for=" + element.id + "]")
.addClass(errorClass);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorClass);
$(element.form).find("label[for=" + element.id + "]")
.removeClass(errorClass);
}
});
More info