Sorry, problem fixed. The obvious solution was to reactivate the form inside the animation function.
I have a form containing buttons that activate javascript functions. I want to prevent the user to activate a function before the previous one has been completed. Each function activates a timed animation.
I have tried:
Problem is that enableForm is called before the animation has finished. I could put enableForm inside a setTimeout, but I don't know in advance how much time the animation takes because it depends by some user input.Code:function animation1(){ disableForm(); doAnimation1(): enableForm(); } function disableForm(){ var theForm; var length; var i; //ottieni la form theForm = document.getElementById("myform"); for(i = 0; i < theForm.length; ++i) theForm.elements[i].disabled = true; } function enableForm(){ var theForm; var length; var i; //ottieni la form theForm = document.getElementById("myform"); for(i = 0; i < theForm.length; ++i) theForm.elements[i].disabled = false; }


Reply With Quote
Bookmarks