From 6491a7149391abcf90b6517f3d81c1e88b4aee8b Mon Sep 17 00:00:00 2001 From: Oliver-ctrlo <119069310+Oliver-ctrlo@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:51:41 +0100 Subject: [PATCH 1/2] Implement setDisabled method for submit button Added a public method to enable and disable the submit button to allow the button to be reset on error. --- src/frontend/components/button/lib/submit-record-button.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontend/components/button/lib/submit-record-button.ts b/src/frontend/components/button/lib/submit-record-button.ts index a857fa9c2..d010a8328 100644 --- a/src/frontend/components/button/lib/submit-record-button.ts +++ b/src/frontend/components/button/lib/submit-record-button.ts @@ -55,4 +55,8 @@ export default class SubmitRecordButton { this.disableButton && $button.prop("disabled", this.requiredHiddenRecordDependentFieldsCleared); }); } + public setDisabled(isDisabled: boolean) { + this.disableButton = isDisabled; + this.el.prop("disabled", isDisabled); + } } From 2d0012319be4fbac1f1a709fcd4aaa0663a3bfd4 Mon Sep 17 00:00:00 2001 From: Oliver-ctrlo <119069310+Oliver-ctrlo@users.noreply.github.com> Date: Wed, 22 Oct 2025 16:56:52 +0100 Subject: [PATCH 2/2] Add SubmitRecordButton to CurvalModalComponent Imported submit-button so the disable flag can be changed by calling setDisabled, re-enabling the submit button on a failed save / error. --- src/frontend/components/modal/modals/curval/lib/component.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/components/modal/modals/curval/lib/component.js b/src/frontend/components/modal/modals/curval/lib/component.js index cea2a4863..62162deb9 100644 --- a/src/frontend/components/modal/modals/curval/lib/component.js +++ b/src/frontend/components/modal/modals/curval/lib/component.js @@ -6,6 +6,7 @@ import { initializeRegisteredComponents } from 'component' import { validateRadioGroup, validateCheckboxGroup } from 'validation' import { fromJson } from 'util/common' import StorageProvider from 'util/storageProvider' +import SubmitRecordButton from '../../../../../components/button/lib/submit-record-button.ts' class CurvalModalComponent extends ModalComponent { @@ -267,7 +268,9 @@ class CurvalModalComponent extends ModalComponent { .parents(".modal-content") .get(0) .scrollIntoView() - form.find("button[type=submit]").prop("disabled", false) + const $submitBtn = form.find('button[type=submit]'); + const submitBtnObj = new SubmitRecordButton($submitBtn); + submitBtnObj.setDisabled(false); } setupModal() {