confirm-submit
A simple little helper to show confirmation prompts for buttons and forms before submitting.
Installation
npm install --save-dev confirm-submit
Requirements
- jQuery
Usage
;
...or simply load src/confirm-submit.js
in your app.
Create a link, button, or form that requires user confirmation before submitting. Add a data attribute named confirm-submit
, which contains the message that should be shown to the user in the alert.
Leave Site
You can use it in conjunction with a Javascript event listener on the click action:
Launch Missile
It even works when used directly on form tags: