What si the best and MOST BROWSERCOMPATIB LE 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(wi ch would looked natural
pair to removeAttribute ) so I used disabled = "disabled" instead.
function bluron(form,ele )
{
document.forms[form].elements[ele].style.backgrou ndColor = "silver";
document.forms[form].elements[ele].blur();
if(document.for ms[form].elements[ele].getAttribute(" disabled") == false )
{ document.forms[form].elements[ele].disabled = "disabled" }
}
// *************** *************** *************** **
function bluroff(ele)
{
if(document.for ms[form].elements[ele].getAttribute(" disabled") != false )
{ document.forms[form].elements[ele].removeAttribut e("disabled") }
document.forms[form].elements[ele].style.backgrou ndColor = "white";
document.forms[form].elements[ele].focus();
}
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(wi ch would looked natural
pair to removeAttribute ) so I used disabled = "disabled" instead.
function bluron(form,ele )
{
document.forms[form].elements[ele].style.backgrou ndColor = "silver";
document.forms[form].elements[ele].blur();
if(document.for ms[form].elements[ele].getAttribute(" disabled") == false )
{ document.forms[form].elements[ele].disabled = "disabled" }
}
// *************** *************** *************** **
function bluroff(ele)
{
if(document.for ms[form].elements[ele].getAttribute(" disabled") != false )
{ document.forms[form].elements[ele].removeAttribut e("disabled") }
document.forms[form].elements[ele].style.backgrou ndColor = "white";
document.forms[form].elements[ele].focus();
}
Comment