Clear Kendo Validator error messages

GANI picture GANI · Apr 23, 2014 · Viewed 9.1k times · Source

I have a form with multiple controls, the validation condition is set in the model using regular expressions, when the condition does't met the error messages shown beside the control. I have another button to clear the validation error messages. How to clear those messages

                     $("#student-details").kendoValidator();

Answer

Lars Höppner picture Lars Höppner · Apr 23, 2014

Taken verbatim from the documentation:

// attach a validator to the container and get a reference
var validator = $("#myform").kendoValidator().data("kendoValidator");

//hide the validation messages when hide button is clicked
$("#hide").click(function() {
    validator.hideMessages();
});