Run "onChange" client script with delay (like autocomplete in reference fields)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2012 03:14 AM
I need an "onChange" Client Script to run over task.short_description field following several milliseconds after user completes data entry. Similar to autocomplete in reference fields - system should wait 250-500 milliseconds after user puts the last letter in short_description and then fire the Client Script. Can you please give me a hint where to dig?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2012 05:32 AM
The onChange will run as the field changes so you can't change the timing of that event specifically. You might be able to get the right timing within that event by using the 'setTimeout' function to introduce a small delay. Details on setTimeout can be found here.
http://www.w3schools.com/jsref/met_win_settimeout.asp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2012 10:24 AM
Thanks Mark and all for pointing me to the right direction!
This thing (part that starts "without globals") helped me to do the trick:
http://stackoverflow.com/questions/1381751/onkeyup-javascript-time-delay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2023 01:37 AM
setTimeout(funName, 1000);