From d112a4f6e8587be3e916483b8f123775e4492580 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sun, 28 Sep 2025 14:16:53 +0200 Subject: [PATCH] fix(frontend): improve form selectors and markup Refactor JavaScript to use querySelector for robustness. Update HTML form to use POST method and correct script loading. Fix message div syntax for better accessibility and compatibility. --- web/static/app.js | 9 +++++---- web/templates/index.html | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index f19dffd..c505965 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -1,10 +1,11 @@ (() => { - const form = document.getElementById("checkout-form"); - const button = document.getElementById("checkout-button"); - const qtyInput = document.getElementById("quantity"); - const message = document.getElementById("message"); + const form = document.querySelector("form"); + const button = document.querySelector("button"); + const qtyInput = document.querySelector("input#quantity"); + const message = document.querySelector("div#message"); if (!form || !button || !qtyInput) { + console.error("Missing required form elements"); return; } diff --git a/web/templates/index.html b/web/templates/index.html index 9af67a9..2b9abd2 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -9,6 +9,7 @@ href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap" /> +
@@ -17,13 +18,12 @@
{{ .PriceDisplay }} {{ .Currency }}
-
+
-
+
-