Edit this page

validateInput

Validates the input element against the declared validation rules.

Example

<div id="myform">
    <input name="username" required /> <br />
    <input name="location" required /> <br />

    <button>Validate only userName field</button>
</div>

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

    //validate the userName input state on button click
    $("button").click(function() {
      if (!validator.validateInput($("input[name=username]"))) {
        alert("UserName is not valid!");
      } else {
        alert("UserName is valid!");
      }
    });
</script>

Parameters

input Element |jQuery

Input element to be validated.

Returns

Boolean true if all validation rules passed successfully.

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy