Ne pas soumettre un inventaire en appuyant sur Entrée

This commit is contained in:
Léo Lanteri Thauvin 2024-12-16 10:31:15 +01:00
parent 2126224e15
commit f8a0f364d1

View file

@ -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 += '</ul>'
} else {
// Prevent erroneous enter key confirmations
// Kinda complicated to filter if click or enter key...
content="Voulez-vous confirmer l'inventaire ?";
}