Skip to content

Commit

Permalink
[#1268] Disabled button in case document upload when form is being su…
Browse files Browse the repository at this point in the history
…bmitted
  • Loading branch information
vaszig committed Mar 23, 2023
1 parent f0437e6 commit 8c29141
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/open_inwoner/js/components/cases/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class DisableSubmitButton {
constructor(form) {
this.form = form
this.form.addEventListener('submit', this.disableButton.bind(this))
}

disableButton() {
const submitButton = this.form.querySelector('button[type="submit"]')
submitButton.setAttribute('disabled', 'true')
}
}

const caseDocumentForms = document.querySelectorAll('#document-upload')
;[...caseDocumentForms].forEach(
(caseDocumentForm) => new DisableSubmitButton(caseDocumentForm)
)
1 change: 1 addition & 0 deletions src/open_inwoner/js/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './anchor-menu'
import './autocomplete-search'
import './autocomplete'
import './autosumbit'
import './cases'
import './confirmation'
import './contacts'
import './datepicker'
Expand Down

0 comments on commit 8c29141

Please sign in to comment.