PDA

View Full Version : Disabling control not disabling its onclick event



SSD
05-15-2008, 04:05 PM
Hi All,

I use a javascript to enable/disable (based on my business criteria) a html control using its 'disabled' property. It works fine but I see even if the control is disabled, its onclick event is fired. How to avoid this? ( ie. I do not want the onclick event to fire when the control is disabled.)

Thanks,
SSD

jscheuer1
05-15-2008, 04:31 PM
Not enough information. If you have an input element and you disable it, it's onclick will not fire. If on the other hand, you are using a link (<a>) tag, the disabled attribute doesn't technically apply to it, if a particular browser gives any effect to it for a link, it is not standard, and as a result, unpredictable. If you don't want an event to fire, remove it.

If you need more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.