What si the best and MOST BROWSERCOMPATIBLE way of making elements disabled
for the user? Also considering different kind of elements: textfields,
selects, radiobuttons and textareas. This is what I have had, its quite okay
in IE but not good enough for Netscape.
- I remember there was problem with setAttribute(wich would looked natural
pair to removeAttribute) so I used disabled = "disabled" instead.
function bluron(form,ele)
{
document.forms[form].elements[ele].style.backgroundColor = "silver";
document.forms[form].elements[ele].blur();
if(document.forms[form].elements[ele].getAttribute("disabled") == false )
{ document.forms[form].elements[ele].disabled = "disabled" }
}
// ***********************************************
function bluroff(ele)
{
if(document.forms[form].elements[ele].getAttribute("disabled") != false )
{ document.forms[form].elements[ele].removeAttribute("disabled") }
document.forms[form].elements[ele].style.backgroundColor = "white";
document.forms[form].elements[ele].focus();
}