Friday, February 03, 2006

Stop a User from Clicking Submit Twice

You can get fancy with this in Mozilla easily, but this works in IE too:


<input type=button value="click me" onClick="alert ('hi'); this.onclick=function() {};">

The onclick event sets itself to be a function with no body. With Mozilla, you can set onclick to be any function as well, which is pretty nifty. Couldn't figure out how to pull this off with IE-- seems the function has to be inline.

No comments:

Labels

Blog Archive

Contributors