From 187d2226e09aa53003f1f8ab3f00305e6e5cf625 Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 28 Oct 2020 12:58:47 -0500 Subject: [PATCH] Fixed duplicate data/form-submit from double click --- babybuddy/static_src/js/babybuddy.js | 7 +++++++ static/babybuddy/js/app.d2994702ae86.js | 7 +++++++ static/babybuddy/js/app.js | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/babybuddy/static_src/js/babybuddy.js b/babybuddy/static_src/js/babybuddy.js index 8c34571c..0771acaf 100644 --- a/babybuddy/static_src/js/babybuddy.js +++ b/babybuddy/static_src/js/babybuddy.js @@ -59,3 +59,10 @@ BabyBuddy.PullToRefresh = function(ptr) { } }; }(PullToRefresh); + +/** + * Fix for duplicate form submission from double pressing submit + */ +$("form").on("submit", function() { + $(this).find("button[type='submit']").prop('disabled', true); +}); \ No newline at end of file diff --git a/static/babybuddy/js/app.d2994702ae86.js b/static/babybuddy/js/app.d2994702ae86.js index 52560741..6fe182dc 100644 --- a/static/babybuddy/js/app.d2994702ae86.js +++ b/static/babybuddy/js/app.d2994702ae86.js @@ -60,6 +60,13 @@ BabyBuddy.PullToRefresh = function(ptr) { }; }(PullToRefresh); +/** + * Fix for duplicate form submission from double pressing submit + */ +$("form").on("submit", function() { + $(this).find("button[type='submit']").prop('disabled', true); +}); + /* Baby Buddy Timer * * Uses a supplied ID to run a timer. The element using the ID must have diff --git a/static/babybuddy/js/app.js b/static/babybuddy/js/app.js index 52560741..6fe182dc 100644 --- a/static/babybuddy/js/app.js +++ b/static/babybuddy/js/app.js @@ -60,6 +60,13 @@ BabyBuddy.PullToRefresh = function(ptr) { }; }(PullToRefresh); +/** + * Fix for duplicate form submission from double pressing submit + */ +$("form").on("submit", function() { + $(this).find("button[type='submit']").prop('disabled', true); +}); + /* Baby Buddy Timer * * Uses a supplied ID to run a timer. The element using the ID must have