Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Disabling a button for 10 seconds


Message #1 by "Sebastiaan Janssen" <genuine2001@h...> on Sun, 6 Oct 2002 11:40:37
How would I go about disabling a form submit button for 10 seconds after 
it's been pushed?
I'm posting data to another frame and I want to prevent post flooding. 

I've made it so that, when you push the button, it checks if all form 
fields are filled in. 
So the submit button already looks like this:

<input name="submit" id="submit" type="submit" value="Post" 
onClick="validateForm('name','','R','tagText','','R');return 
document.returnValue;" />

First thing I want to do is disable this button as soon as it is pressed, 
how do I add that code?

Then, I want to trigger the timer from the other frame. This I can do 
with onLoad, but how do I write a function that will wait for ten seconds 
and then enable the button again?

Thanks!
Sebastiaan.

  Return to Index