Disabling a button for 60 seconds.


The above line of code is in a form, i would like to disable the button for 60 seconds so the user has to wait a minute before they can continue.
I am a little unsure on how to do this.

Thanks in advance.

  1. Set it as disabled in html
  2. Wait 60 seconds http://www.w3schools.com/jsref/met_win_settimeout.asp
  3. enable the button http://www.w3schools.com/jsref/prop_pushbutton_disabled.asp

If you use Jquery already you can use a slightly simpler syntax, but it’s pretty much the same (and vanilla javascript will still of course work)

Wow, that was quick :o thanks 8)

Sponsor our Newsletter | Privacy Policy | Terms of Service