asp.net-mvcvalidationmvvmkendo-uikendo-validator

Clear Kendo Validator error messages


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();

Solution

  • 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();
    });