Button not disabled in Firefox and Chrome
When you try to disable any button in your web application using this javascript function
document.getElementById(‘buttonId’).disabled=true;
You may find that it will work in IE but on Firefox and Chrome.
Reason:
From W3Scholl,
“Enabled” Property isn’t standard property of XHTML 4(It’s Microsoft standard.).
So the solution would be to add this piece of code
var obj = document.getElementById(‘buttonId”);
getLabel = function(elem){
if (elem.id && elem.id==”label”) {
elem.id = “disabledLabel”;
}
};
Dom.getElementsBy(getLabel ,’td’, obj);









It works for me but it does not show the button as grayed out . So the user does not know until and unless he clicks on button.
document.getElementById(‘buttonId’).disabled=true;
this javascript function works in my chrome 5.0.375.127 and firefox 3.6.8
it can disable a button.