From c3f1dc62cffdfe573e33d3deb77eb51823c6eaf8 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 14 May 2024 08:31:38 +0200 Subject: [PATCH] btn new disabled when new form opened --- customprompts/mzta-custom-prompts.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/customprompts/mzta-custom-prompts.js b/customprompts/mzta-custom-prompts.js index 60f90cfd..bcb052eb 100644 --- a/customprompts/mzta-custom-prompts.js +++ b/customprompts/mzta-custom-prompts.js @@ -128,6 +128,7 @@ document.addEventListener('DOMContentLoaded', async () => { // Show the new item form function handleNewClick(e) { e.preventDefault(); + e.target.disabled = true; document.getElementById('formNew').style.display = 'block'; } btnNew.addEventListener('click', handleNewClick); @@ -352,6 +353,7 @@ document.addEventListener('DOMContentLoaded', async () => { cancelBtn.addEventListener('click', handleCancelClick); // console.log('>>>>>>>>>>>>> deleteBtn: ' + JSON.stringify(deleteBtn)); // console.log('>>>>>>>>>>>>> newItem: ' + JSON.stringify(newItem)); + document.getElementById('btnNew').disabled = false; clearFields(); setSomethingChanged(); i18n.updateDocument();