jQuery UI Widgets › Forums › General Discussions › Plugins › Validator, Drag & Drop, Sortable › jqxValidator keyup is triggered by TAB key
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 12 years, 4 months ago.
-
Author
-
Hello,
In this example :
Name validation :
{ input: ‘#userInput’, message: ‘Username is required!’, action: ‘keyup, blur’, rule: ‘required’ },Password validation :
{ input: ‘#passwordInput’, message: ‘Password is required!’, action: ‘keyup, blur’, rule: ‘required’ },When you click on the UserName Field, nothing happen. If you hit “TAB” key inside UserName field, you will switch to Password field.
Validation for UserName will be triggered by the “blur” event and will return an error since the field is empty.
BUT… the issue is with the Password Field. Trigger are : KeyUp and Blur. When you “enter” the field using TAB Key, you trigger the keyup event and the validator return an error right away.
Is there a way to “ignore” TAB key inside Keyup Event ?
Thanks
Jean-Frederic
Canam GroupHello Jean-Frederic,
Unfortunately, this cannot be achieved. You can, however, change the event to “keydown” instead.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello,
Unfortunately, this is not better, this is even worst.
If the validation of the field is “must not be empty”.
Then I hit TAB, I enter that field and yes, there is no error validation.
But when I type the first Key, on keydown event, it will look for the field to not be empty, but it will be empty since the letter is not added to the field before the “keydown” event.
So, I end up with a field, with one letter inside and an error message saying the field must not be empty.
Hi jean-frederic,
Unfortunately, we cannot provide you with a solution on the matter. Maybe you can fire the validation on “blur” only?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.