From f8a0f364d1db10a6045cd8b9bbcd4969474be748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lanteri=20Thauvin?= Date: Mon, 16 Dec 2024 10:31:15 +0100 Subject: [PATCH] =?UTF-8?q?Ne=20pas=20soumettre=20un=20inventaire=20en=20a?= =?UTF-8?q?ppuyant=20sur=20Entr=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kfet/templates/kfet/inventory_create.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kfet/templates/kfet/inventory_create.html b/kfet/templates/kfet/inventory_create.html index 45bd48ed..7eb2d135 100644 --- a/kfet/templates/kfet/inventory_create.html +++ b/kfet/templates/kfet/inventory_create.html @@ -190,6 +190,13 @@ $(document).ready(function() { } }); + // Prevent erroneous enter key confirmations + $("input").on("keydown", function(e) { + if (e.key === "Enter" && !e.ctrlKey) { + e.preventDefault(); + } + }); + $('input[type="submit"]').on("click", function(e) { e.preventDefault(); @@ -207,8 +214,6 @@ $(document).ready(function() { } content += '' } else { - // Prevent erroneous enter key confirmations - // Kinda complicated to filter if click or enter key... content="Voulez-vous confirmer l'inventaire ?"; }