javascript: how to delay submitting data when several checkboxes clicked in short time interval?
- by ~knb
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.