473,467 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Use .blur() without locking cursor (jQuery)

5 New Member
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?
Sep 16 '10 #1

✓ answered by gits

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

5 2335
gits
5,390 Recognized Expert Moderator Expert
events cannot be fired async - but you could use an async validation by doing that serverside and start a XMLHttpRequest on blur which would send the value to the server which then could be validated there
Sep 17 '10 #2
Parmenides
5 New Member
Thanks, I can do that, but I was hoping to avoid that. What about async a function called inside the event?
Sep 17 '10 #3
gits
5,390 Recognized Expert Moderator Expert
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 ...
Sep 17 '10 #4
Parmenides
5 New Member
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.
Sep 17 '10 #5
gits
5,390 Recognized Expert Moderator Expert
it might delay the code's execution but when it runs then everything has to wait ... so lets say the execution starts 1s later on ... then the timed out code runs and after that the next code runs ...
Sep 17 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Timo | last post by:
I'm trying to make a thread safe object cache without locking. The objects are cached by the id of the data dict given in __new__. Objects are removed from the cache as soon as they are no longer...
1
by: eskil | last post by:
Hi, I have an invoice which is being printed on two different trays. This is being done by some simple code in VB, and it works. However, my report goes into design mode in order to change the...
0
by: Scott Meddows | last post by:
I want to load a multipage TIFF image into memory as an Image object but I read that the FromFile method locks the file. Can I load this into a stream, close the physical file then manipulate the...
3
by: Danny Tuppeny | last post by:
Hi all, Something bugs me. It's the whole "not accessing a control from a non-UI thread" thing... In my world, all properties would be safe from all threads (maybe they'd be locked...
4
by: John please don't spam me! | last post by:
VB.Net 2003 Hi, 2 questions: 1. I want to read a file in without locking it, as it is Log file. 2. I want to be able to read from the last point it wa read upto. The project is: Search...
1
by: tian | last post by:
Hi could someone hel me with this dillema. In my current network setup, a certain Access Database(.mdb) File must be opened by two different people at the same time. At this moment in time if one...
5
by: Shailja | last post by:
Hi, How to lock the grid without locking scrollbar? If you know the answer, kindly let me know
2
by: Marcolino | last post by:
Hy Guys, I have a problem loading JPG in a Picture Box. I need to load a jpg files into a PB and then unlock the original JPG. I'm using following code: Dim picture1 As PictureBox Dim...
1
by: jasondi | last post by:
Hello, I've a scenario with multiple threads that performs select/insert/update on the same table. Basically, the flow is: SELECT * FROM tablex where pk=? if empty INSERT into tablex...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.