Validation on Keydown?

2 posts, 0 answers
  1. StevenDom
    StevenDom avatar
    14 posts
    Member since:
    Aug 2014

    Posted 19 Mar 2015 Link to this post

    Hi all,

    I have a validator configured to perform validation on a textbox. I am seeing the validator being called on the keydown event. This brings up two questions.

    1) Why is it calling the validator for every keystroke and not just when control leaves the textbox? I read that by default it validates only onblur.
    2) Since the validator is being called on the keydown event the validation is one stroke behind. For example if I am typing 'abcd' I see the following
        press a - validator input.val() = ''
        press b - validator input.val() = 'a'
        press c - validator input.val() = 'ab'
        press d - validator input.val() = 'abc'

    Because of this I cannot validate properly. What am I doing wrong?
  2. Kiril Nikolov
    Kiril Nikolov avatar
    2596 posts

    Posted 20 Mar 2015 Link to this post

    Hello Steven,

    I was not able to reproduce this behavior in the following example, please let me know what I missed:

    You can see this screencast as well:

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top