开发者

how can fire only one click event even the user clicks button 2-3 times at the same time?

开发者 https://www.devze.com 2023-01-21 16:48 出处:网络
I have a add to list button.when user clicks on button the data in text box gets added in listbox.User can not add same data. but the problem is that is user clicks add button 2-3 times with in a seco

I have a add to list button.when user clicks on button the data in text box gets added in listbox.User can not add same data. but the problem is that is user clicks add button 2-3 times with in a seconds the data is getting added 2 times in list. And if user does not clicks on button like this my javascript validation is working fine but it is getting failed on this so fast click events.

Note:data is getting added only two time regardless of no of开发者_Python百科 button clicks in a second.

So how can fire only one click event even the user clicks button 2-3 times at the same time?


In the method that handles the button click disable the button before you do anything else. Just before the method finishes, re-enable the button.

0

精彩评论

暂无评论...
验证码 换一张
取 消