Archive for VTW 
 


       VTW Forum Index -> Javascript
computergeek67

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.

       VTW Forum Index -> Javascript
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum