dynasource / js-submitonce
Protects forms to be submitted twice
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/dynasource/js-submitonce
This package is not auto-updated.
Last update: 2025-10-18 02:06:17 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' }); });