From 9fc7ad35e5586ab5ff8bd1c371ce4a07e3523f50 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 26 Jul 2017 08:37:14 +0000 Subject: [PATCH] form: Block the submit button to not allow Chrome/Edge to submit multiple times in case of multiple clicks on slow server. Bug introduced in 0.41 doesn't work with Chrome: the form is not submitted git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3836 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/form.php b/form.php index a74ddce..2db56bc 100644 --- a/form.php +++ b/form.php @@ -844,9 +844,9 @@ class formfield // This code is needed by Chrome and Edge which allow multiple submission of // a form $res .= " onclick='submit=this ; "; - $res .= "submit.setAttribute(\"disabled\", \"disabled\");"; $res .= " setTimeout(function() {"; - $res .= " submit.removeAttribute(\"disabled\"); }, 15000);"; + $res .= " submit.setAttribute(\"disabled\", \"disabled\");"; + $res .= " }, 1);"; $res .= "'"; $res .= "/>\n"; $res .= " \n";