I have a few text input fields for data entry. I use .blur() for client data validation. Some of the fields requires a little extra validation processing. This creates a long pause (i.e. the cursor is locked) as the user tabs from one input to the next. Is there some way to fire up the .blur() event asynchronously so that the user can continue typing in the next field before the validation process for the previous is completed?
Use .blur() without locking cursor (jQuery)
Collapse
X
-
-
Thanks, I can do that, but I was hoping to avoid that. What about async a function called inside the event?Comment
-
javascript code cannot be executed async, even when you delay it with a timeout the code runs after the specified amount of time ... but it runs first before you could proceed then - the browser needs to be free of the code that does the validation to not only execute this code first - javascript has no multithreading capabilities or similar - with a XMLHttpRequest this could be 'simulated' a bit ...Comment
-
Thanks. Actually the timeout code is working very nicely now. Are you saying that all subsequent work must wait until after the timeout? All I know is that it removes the cursor lag. I'm not sure if there is some side effect you have in mind.Comment
Comment