Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philipnewcomer/confirm-submit
A simple little helper to show confirmation prompts for buttons and forms before submitting.
https://github.com/philipnewcomer/confirm-submit
confirm form forms html javascript npm-package submit
Last synced: about 1 month ago
JSON representation
A simple little helper to show confirmation prompts for buttons and forms before submitting.
- Host: GitHub
- URL: https://github.com/philipnewcomer/confirm-submit
- Owner: philipnewcomer
- License: gpl-3.0
- Created: 2018-02-10T22:39:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-12T01:31:42.000Z (almost 7 years ago)
- Last Synced: 2024-12-03T05:36:26.786Z (2 months ago)
- Topics: confirm, form, forms, html, javascript, npm-package, submit
- Language: JavaScript
- Homepage: https://npmjs.org/package/confirm-submit
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```javascript
require('confirm-submit');
```
...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.
```html
Leave Site
```You can use it in conjunction with a Javascript event listener on the click action:
```html
Launch Missile
```It even works when used directly on form tags:
```html
```