From 91916533da011591951539a1970f0c15f265203a Mon Sep 17 00:00:00 2001 From: dbianco Date: Wed, 26 May 2021 11:42:53 -0300 Subject: [PATCH] add timeout to wait the form load --- app/views/surveys/component/disable-fields.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/views/surveys/component/disable-fields.js b/app/views/surveys/component/disable-fields.js index 6cabdca17..5e6b346b8 100644 --- a/app/views/surveys/component/disable-fields.js +++ b/app/views/surveys/component/disable-fields.js @@ -1,6 +1,4 @@ -console.log("Wait for onload"); -window.onload = -function myFunction() { +function disableFields() { console.log("Disabling fields"); var inputs = document.getElementsByTagName("input"); for (var i = 0; i < inputs.length; i++) { @@ -16,4 +14,8 @@ function myFunction() { for (var i = 0; i < button.length; i++) { button[i].disabled = true; } -} \ No newline at end of file +} +setTimeout(() => {disableFields()}, 1000); +setTimeout(() => {disableFields()}, 2000); +setTimeout(() => {disableFields()}, 3000); +setTimeout(() => {disableFields()}, 4000); \ No newline at end of file