An open API service indexing awesome lists of open source software.

https://github.com/sarfraznawaz2005/buttondisabler

Simple and no-dependency, vanilla JavaScript package to disable submit button to avoid duplicate form submissions.
https://github.com/sarfraznawaz2005/buttondisabler

duplicates es6 form library package submission validation

Last synced: 17 days ago
JSON representation

Simple and no-dependency, vanilla JavaScript package to disable submit button to avoid duplicate form submissions.

Awesome Lists containing this project

README

        

# buttondisabler

Simple and no-dependency, vanilla JavaScript package to disable submit button to avoid duplicate form submissions.

### Installation and Usage

**ES6 Way**

`npm install buttondisabler`

```javascript
import buttondisabler from 'buttondisabler';

new buttondisabler({
selector: 'button[type="submit"], input[type="submit"]',
timeout: 5000,
text: 'Wait...'
});
```

**Or via `script` tag:**

```html

```
```javascript

new buttondisabler({
selector: 'button[type="submit"], input[type="submit"]',
timeout: 5000,
text: 'Wait...'
});
```

If you want to use those three options as shown above with same values as above, then those are so by default so you can omit them and instead use `new buttondisabler()` without options.