dynasource / js-submitonce
Protects forms to be submitted twice
0.1
2017-05-13 12:19 UTC
Requires
None
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-19 06:11:45 UTC
README
Forms usually need to be submitted once.
When double submission does occur (i.e. because of double clicking), unwanted side effect can occur:
- duplication of records in a database
- multiple actions such as i.e. sending duplicate emails
- thrown exceptions as systems could not expect certain actions to be executed twice
This "Js-SubmitOnce" script is a plain JS vanilla script to prevent this undesired behavior.
Installation
Installation is done by composer, requiring:
{
"require": {
"dynasource/js-submitonce" : "*"
}
}
Include it in your webpage with:
window.addEventListener('load', function () { new SubmitOnce({ 'selector': 'btn' }); });