View Full Version : Disabling button in Firefox trick?

08-03-2008, 07:10 PM
Is there a trick to being able to disable a button in FF3? The following code works in IE7 but not FF3 or Safari:

document.getElementById("update_button").disabled = true;

08-04-2008, 12:13 AM
document.getElementById("update_button").disabled = 'disabled';

Not all browsers have a default visual style for disabled- you may need to define it yourself.

You can use css to apply a custom style to buttons with the 'disabled' attribute,
or use js to change the style (or className) of a button inline, when you disable it.