computergeek67 Administrator


Joined: 31 Jul 2007 Posts: 144 Tokens: 147 Location: US
|
Posted: Tue Oct 09, 2007 7:20 pm Post subject: Disable Buttons On Click |
|
|
Say that you have an email form on your site, but one of your users accidentally hits the button twice and, therefore, sends two emails. This tutorial will show how to stop that from happening.
Place this code between the "<head>" tags of your page:
| Code: | <script language=”JavaScript” type=”text/javascript”>
function dis(a){
a.disabled = “disabled”;
}
</script> |
Now for the button code:
| Code: | | <input type=”submit” value=”Submit” name=”B1″ onclick=”dis(this);”> |
The "onclick" statment is what does the trick here.
_________________
Come to me if you have any questions  |
|