This is a migrated thread and some comments may be shown as answers.

Validation on Keydown?

1 Answer 175 Views
Validation
This is a migrated thread and some comments may be shown as answers.
StevenDom
Top achievements
Rank 1
StevenDom asked on 19 Mar 2015, 09:10 PM
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?

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 20 Mar 2015, 09:58 AM

Hello Steven,

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

http://dojo.telerik.com/aJOcU

You can see this screencast as well:

http://screencast.com/t/Wji8WhRt

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Validation
Asked by
StevenDom
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or