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

29 lines
798 B
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: none
group: unassigned
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2018-12-13 13:39:08 +05:30
# Dirty Submit
2020-03-13 15:44:24 +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.
2021-09-04 01:27:46 +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
2020-05-24 23:13:21 +05:30
```javascript
2018-12-13 13:39:08 +05:30
import dirtySubmitFactory from './dirty_submit/dirty_submit_form';
new DirtySubmitForm(document.querySelector('form'));
// or
new DirtySubmitForm(document.querySelectorAll('form'));
```