debian-mirror-gitlab/doc/development/new_fe_guide/modules/dirty_submit.md

23 lines
570 B
Markdown
Raw Normal View History

2018-12-13 13:39:08 +05:30
# Dirty Submit
2020-03-09 13:42:32 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/21115) in GitLab 11.3.
2018-12-13 13:39:08 +05:30
## Summary
Prevent submitting forms with no changes.
Currently handles `input`, `textarea` and `select` elements.
2019-12-21 20:55:43 +05:30
Also, see [the code](https://gitlab.com/gitlab-org/gitlab/blob/master/app/assets/javascripts/dirty_submit/)
2019-12-04 20:38:33 +05:30
within the GitLab project.
2018-12-13 13:39:08 +05:30
## Usage
```js
import dirtySubmitFactory from './dirty_submit/dirty_submit_form';
new DirtySubmitForm(document.querySelector('form'));
// or
new DirtySubmitForm(document.querySelectorAll('form'));
```