errors

Get the error messages if any.

Example

<div id="myform">
    <input name="username" required /> <br />
    <button id="save">Save</button>
    <div id="errors"></div>
</div>

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

    $("#save").click(function() {
      //validate the input elements and check if there are any errors
      if (validatable.validate() === false) {
        // get the errors and write them out to the "errors" html container
        var errors = validatable.errors();
        $(errors).each(function() {
          $("#errors").html(this);
        });
      }
    });
</script>

Returns

Array Messages for the failed validation rules.

In this article