How to clear jQuery validation error messages?

You want the resetForm() method:

var validator = $("#myform").validate(
   ...
   ...
);

$(".cancel").click(function() {
    validator.resetForm();
});

I grabbed it from the source of one of their demos.

Note: This code won’t work for Bootstrap 3.

Leave a Comment