Posted on 2004-11-17
I've got a text field that looks like this :
<input type="text" name="my_text_field" onKeyUp="do_this_task();">
The problem is that onKeyUp will call the function "do_this_task()" the very instant the key is "up" ... how do I add a delay in the do_this_task() function, so that the actions will only be performed after a full second of inactivity (or 500 milliseconds or whatever) ?
If someone types really fast, i'd like there to be a bit of a pause (to give them a brief bit of time to finish typing) before the actions are performed. Any ideas ?