javascript: how to delay submitting data when several checkboxes clicked in short time interval?

Posted by ~knb on Stack Overflow See other posts from Stack Overflow or by ~knb
Published on 2010-05-28T12:29:34Z Indexed on 2010/05/28 12:31 UTC
Read the original article Hit count: 232

Filed under:
|
|
|
|

I have an array of checkboxes in a complex dynamic-html form. Whenever a user clicks one checkbox, a fairly expensive query is generated and submitted to a remote server. I want to delay this submit action depending on the users next action. If the user clicks several checkboxes quickly, all of the first clicks should be discarded, only the last one is processed and eventually submitted after 1 second or so. maybe this is a common problem but I have never worked with timeouts before.

© Stack Overflow or respective owner

Related posts about html

Related posts about AJAX