Enable Buttons
Automatically enable/disable buttons based on required form inputs
- Plain old vanilla JS
- Just 0.7kb gzipped
Installation
npm install enable-buttons
Usage
Submit
Options
The enableButtons
function can take an object, that
may include the following properties.
className
The class name that Enable Buttons uses to locate sections.
Defaults to js-enable-buttons
.
Data attributes
ignore
If there is a button that you don't want Enable Buttons to
do it's magic on, then you can add the data-ignore
attribute to it.
Submit Don't touch me
Browser support
Enable Buttons is packaged with Babel, and
makes use of Array.from
.
If you want Enable Buttons to work on browsers that don't support
this method (e.g. IE11), then you will need to
polyfill Array.from
before calling enableButtons
.