From f24802ac36537b318c6553a290af711101b52d0c Mon Sep 17 00:00:00 2001 From: Daniel Ursache Date: Wed, 13 May 2026 16:20:04 +0300 Subject: [PATCH 1/2] Clear the field if the user does not want to sign the form --- backend/templates/v2/form/modals/confirmation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/templates/v2/form/modals/confirmation.html b/backend/templates/v2/form/modals/confirmation.html index 7e32917bc..bd4327fd5 100644 --- a/backend/templates/v2/form/modals/confirmation.html +++ b/backend/templates/v2/form/modals/confirmation.html @@ -11,4 +11,4 @@ {% trans "Continue" as confirm_label %} -{% include "public/components/modal.html" with modal_title=confirmation_title modal_body=confirmation_body modal_title_id="confirmation-modal-title" cancel_label=cancel_label cancel_id="back-to-signature" cancel_type="button" cancel_attrs='@click="confirmationModalIsOpen = false" aria-label="Close"' confirm_label=confirm_label confirm_id="submit-without-signature" confirm_type="submit" confirm_attrs='data-action="send" x-on:click="confirmationModalIsOpen = false"' only %} +{% include "public/components/modal.html" with modal_title=confirmation_title modal_body=confirmation_body modal_title_id="confirmation-modal-title" cancel_label=cancel_label cancel_id="back-to-signature" cancel_type="button" cancel_attrs='@click="confirmationModalIsOpen = false" aria-label="Close"' confirm_label=confirm_label confirm_id="submit-without-signature" confirm_type="submit" confirm_attrs='data-action="send" @click="clearSignature(); confirmationModalIsOpen = false"' only %} From f6ed06a17f730e9b570fbb09a549afd356527aad Mon Sep 17 00:00:00 2001 From: Daniel Ursache Date: Wed, 13 May 2026 16:28:06 +0300 Subject: [PATCH 2/2] Temporarily disable the Send Signed Form button after submit --- backend/assets/twoPercentForm.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/assets/twoPercentForm.js b/backend/assets/twoPercentForm.js index ba75b6edb..0baa4b40b 100644 --- a/backend/assets/twoPercentForm.js +++ b/backend/assets/twoPercentForm.js @@ -10,6 +10,7 @@ export default function() { this.form = document.getElementById("two-percent-form"); this.signatureInput = document.getElementById("signature-input"); this.signaturePreview = document.getElementById("signature-preview"); + this.submitButton = document.getElementById("submit-with-signature"); this.pristine = new Pristine(this.form, { errorTextClass: "mt-2 text-sm text-red-600", @@ -25,9 +26,17 @@ export default function() { } }, "Acest câmp este obligatoriu", 2, false); }, + tempDisableSubmitButton() { + this.submitButton.disabled = true; + setTimeout(function() { this.enableSubmitButton(); }, 5000); + }, + enableSubmitButton() { + this.submitButton.disabled = false; + }, sendSignedForm() { this.validateSignature = true; if (this.pristine.validate()) { + this.tempDisableSubmitButton(); this.form.submit(); } },