Recently, when debugging bugs, because of the boredom of leisure, I just submit data on the button above, I went crazy like many times click on the data, and I did not think that this system to me to build a lot of the same objects, we today's problems from this inside to explore:
For example, there is a button, <input type= "button" value= "Request" id= "appbtn" onclick= "return Submit ()" > Jump to the JS in Submit (), We can add the following code to this page
<script type= "Text/javascript" >
$ ("#appBtn"). Click (function () {
Let button not click again
$ (this). attr ("Disabled", "disabled");
Execute other code, such as submitting events, etc.
MyFunc ();
});
This appbtn is the ID of this button, then, you only click the first time effective, when you click on the first time, when clicked, he set this button to disabled, even if the speed behind you even faster, but you can not click the data, This solves the problem of submitting click multiple times