diff --git a/Javascript/app.js b/Javascript/app.js index b9507f3..a2857f6 100644 --- a/Javascript/app.js +++ b/Javascript/app.js @@ -26,13 +26,14 @@ document.addEventListener("DOMContentLoaded", function() { }); // Für Patenshop document.getElementById('donationForm').addEventListener('submit', function(event) { - event.preventDefault(); // Verhindert die tatsächliche Formularübermittlung + event.preventDefault(); alert('Alles in Ordnung. Vielen Dank für Ihre Spende!'); - this.reset(); // Setzt das Formular zurück + this.reset(); }); + // Für Preis document.addEventListener('DOMContentLoaded', function() { - updatePrice(); // Initialer Preis wird beim Laden der Seite gesetzt + updatePrice(); }); function updatePrice() { @@ -43,7 +44,7 @@ function updatePrice() { const pricePerUnit = selectedFood.getAttribute('data-price'); const quantity = mengeSelect.value; const total = pricePerUnit * quantity; - priceInput.value = total.toFixed(2); // Preis wird im Preisfeld angezeigt + priceInput.value = total.toFixed(2); } function showDonationAmount() {