After a form is submitted, this plugin will disable it for 750 milliseconds to prevent duplicate form submits. After the 750 millisecond wait the form will be re-enabled (This is important if some one uses "Esc" to stop a form submit from completing)
$('form').debounceSubmit(); // Applies to all forms
$('#payment-form').debounceSubmit(); // Applies to #payment-form
$('#another-payment-form').debounceSubmit({
wait: 500
});
- wait: (Number, Default:
750
) The amount of time (in milliseconds) between when the form is disabled and when it is re-enabled - debug: (Boolean, Default:
false
) Enable/Disable console.logs() for submit handler being enabled, disabled, & prevented
Clicking the submit button multiple times causes the form to make several partial/canceled requests to the server that result in a tax calculation error during checkout
Clicking the submit button multiple times only allows one successfull submit to happen