Skip to content

Commit

Permalink
add timeout to wait the form load
Browse files Browse the repository at this point in the history
  • Loading branch information
dbianco committed May 26, 2021
1 parent 7b3f861 commit 9191653
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/views/surveys/component/disable-fields.js
Original file line number Diff line number Diff line change
@@ -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++) {
Expand All @@ -16,4 +14,8 @@ function myFunction() {
for (var i = 0; i < button.length; i++) {
button[i].disabled = true;
}
}
}
setTimeout(() => {disableFields()}, 1000);
setTimeout(() => {disableFields()}, 2000);
setTimeout(() => {disableFields()}, 3000);
setTimeout(() => {disableFields()}, 4000);

0 comments on commit 9191653

Please sign in to comment.