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?
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?