5

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();
Lars Höppner
  • 18,252
  • 2
  • 45
  • 73
GANI
  • 2,013
  • 4
  • 35
  • 69

1 Answers1

10

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();
});
Lars Höppner
  • 18,252
  • 2
  • 45
  • 73
  • Tried this way got this error "JavaScript runtime error: Object doesn't support property or method 'hideMessages" – GANI Apr 23 '14 at 18:16
  • 3
    this was introduced with Q1 2013, so if you use an older version, try this workaround: $(document.body).find("span.k-tooltip-validation").hide() – Lars Höppner Apr 23 '14 at 18:30