From 85ff32a5e81f7a42c7e48a6fe97f761ad9d6af0f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 23 Feb 2022 18:35:19 +0000 Subject: [PATCH] donate: Disable all buttons after submit This helps to avoid any double-submissions of the form Signed-off-by: Michael Tremer --- src/templates/donate/donate.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/templates/donate/donate.html b/src/templates/donate/donate.html index 6337d4aa..d78a5754 100644 --- a/src/templates/donate/donate.html +++ b/src/templates/donate/donate.html @@ -23,7 +23,7 @@
-
+ {% raw xsrf_form_html() %}
@@ -510,6 +510,7 @@ var frequency = $("input[name='frequency']"); var submit = $("#donate"); var modal = $("#modal-monthly-suggestions"); + var form = $("#donation-form"); // Adjust form to default currency if (currency.val() == "EUR") { @@ -632,6 +633,12 @@ } }); + // Disable all submit buttons after the form has been submitted + form.one("submit", function() { + submit.prop("disabled", true); + $(".monthly-amount-suggestion").prop("disabled", true); + }); + $(".monthly-amount-suggestion").click(function (event) { // Set frequency to monthly $("input[name='frequency-selector']").prop("checked", false); -- 2.47.3