https://github.com/anduin2017/jquery-disable-with
Library to enable auto-disable options when submitting a form.
https://github.com/anduin2017/jquery-disable-with
Last synced: 8 months ago
JSON representation
Library to enable auto-disable options when submitting a form.
- Host: GitHub
- URL: https://github.com/anduin2017/jquery-disable-with
- Owner: Anduin2017
- License: mit
- Created: 2018-03-23T05:11:06.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2025-01-02T17:44:29.000Z (over 1 year ago)
- Last Synced: 2025-10-11T22:06:21.716Z (8 months ago)
- Language: TypeScript
- Homepage: https://developer.aiursoft.com/Samples/DisableWithForm
- Size: 440 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jquery-disable-with
[](https://www.npmjs.com/package/jquery-disable-with)
[](https://gitlab.aiursoft.cn/anduin/jquery-disable-with/-/commits/master?ref_type=heads)
Add-on to jQuery to enable auto-disable options when submitting a form in data-disable-with attributes.
See a demo [here](https://developer.aiursoft.com/Samples/DisableWithForm)
## How to install
```bash
npm install --save jquery-disable-with
```
And check your reference. jQuery is required!
```html
```
Or using es6:
```javascript
import DisableWith from 'jquery-disable-with';
```
## How to use
Create a form
```html
```
Add a submit button:
```html
```
Or a simple button like this:
```html
Sign in
```
Init this libarary:
```javascript
new DisableWith('data-disable-with');
```
Run your app and click the sign-in button. When the user is submitting the form, the sign-in button will be disabled, and the text will be changed to 'Signing in...' so that the user won't press it again until the server responds.
* Support with jQuery validation. Please view document [here](https://github.com/jquery-validation/jquery-validation)
* Support with `required` attribute. Won't action when required fields are empty.