Kendo Validator - Focus on first invalid field

2 posts, 0 answers
  1. Paul
    Paul avatar
    31 posts
    Member since:
    Mar 2013

    Posted 13 Jan Link to this post

    Hi there,

    When using kendo Validator - is there a configuration option to set the focus to the first invalid field?

    With the current application I am working on there are several long forms - it would be beneficial if the browser scrolled to the invalid field.

    I can see how to do this easily with jQuery validate - but I can't seem to see an obvious extension point to do this with kendo Validator?



  2. Eduardo Serra
    Eduardo Serra avatar
    90 posts

    Posted 13 Jan Link to this post

    Hello Paul,

    At the moment, there is no option in the Kendo UI Validator that allows for an automatic focus on the first invalid field. 

    We can achieve the behavior by subscribing to the validate event which is triggered after the validation has been made, whether there were errors or not, and manually focus on the first input with the k-invalid class using jQuery's first selector.

    I have prepared a sample for you in the Kendo UI Dojo; you can take a look at it here. The relevant section:

    var validator = $("#ticketsForm").kendoValidator({
       validate: function(){

    I hope this helps!

    Eduardo Serra
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top