views:

22

answers:

1

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 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?

A: 

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.

Matt Smith