From 89ca77ae7fc94e66596b02b66c5919c59a65d6ab Mon Sep 17 00:00:00 2001 From: LD-Reborn Date: Sun, 30 Nov 2025 21:33:10 +0100 Subject: [PATCH] Fixed input validation for order item quantity --- Views/Order/Join.cshtml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Views/Order/Join.cshtml b/Views/Order/Join.cshtml index 6888335..6cda1fa 100644 --- a/Views/Order/Join.cshtml +++ b/Views/Order/Join.cshtml @@ -51,7 +51,7 @@
- +
@@ -159,11 +159,12 @@ function updatePrice() { const select = document.getElementById('menuItemId'); const quantity = document.getElementById('quantity').value; const selectedOption = select.options[select.selectedIndex]; - const price = parseFloat(selectedOption.dataset.price) || 0; + const price = parseFloat(selectedOption.dataset.price.replace(",", ".")) || 0; const total = (price * quantity).toFixed(2); document.getElementById('totalPrice').textContent = total; } document.getElementById('quantity').addEventListener('change', updatePrice); +document.getElementById('quantity').addEventListener('input', updatePrice); document.getElementById('menuItemId').addEventListener('change', updatePrice); \ No newline at end of file