Posts

Showing posts from April, 2011

Web Development: Disable, Validate, & Enable Buttons

I bounced into this problem during a Web UI development, of which I'd say it's quite a common issue. Whenever a button is clicked, ideally it would be good to disable it to avoid continuous clicking. Of course, it may not be the case in certain circumstances, i.e. loading of images, of which sometimes clicking the button again would surely making it load faster. However, in the latest development that I involved in, I need to make sure that the button as to be disabled to avoid continuous clicking that would cause some Javascript error that would cause the whole website to stop working. I've no idea why this is happening, and my only explanation should be because the execution time is short & it's AJAX, therefore the continuous clicking would cause some process not able to be executed timely and causing this issue. So after some research on the Internet, I found that in order to disable the button during a button click event that has a postback, the onclick event