From: Michael Tremer Date: Wed, 23 Feb 2022 18:35:19 +0000 (+0000) Subject: donate: Disable all buttons after submit X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85ff32a5e81f7a42c7e48a6fe97f761ad9d6af0f;p=ipfire.org.git donate: Disable all buttons after submit This helps to avoid any double-submissions of the form Signed-off-by: Michael Tremer --- 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);