C
CES
All,
I'm at a loss, the code below works in IE but not in Netscape and I'm
unskilled enough not to know why.
Essentially this code looks thru all of the form fields and if the input box
has a attribute of disabled="true", attribute would only be present if the
field was disabled, then the label field's class is changed to a grayed out
color.
--- The first problem seems to be with the v==true statement, I've tried
every variation I can think of but v==true is the only one that works in IE.
--- The second problem is the way IE & Netscape/Opera uses different class
attribute statements, is their a way of using 1 setAttribute statement that
will work in IE and Netscape as apposed to:
setAttribute("className", "xxx") for IE
and
setAttribute("class", "xxx") for Netscape
Any Help on these issues will be appreciated.
CES
function fDisableLable(){
for(var a = 0;a < document.forms.length;a++){
var fname = document.forms[a].name;
var f = document.forms[fname];
for(c = 0;c < f.length;c++){
var x = f.elements[c].id;
if(x!=""){
var v = f.elements[x].getAttribute("disabled")
var t = f.elements[x].getAttribute("type")
//This is where I'm having the problem
if((v==true)&&(t!="button")&&(t!="submit")){
//ie version
document.getElementById(x +
'Lable').setAttribute("className", "dataLable_TextDisabled");
//netscape version
document.getElementById(x +
'Lable').setAttribute("class", "dataLable_TextDisabled");
}
}
}
}
}
I'm at a loss, the code below works in IE but not in Netscape and I'm
unskilled enough not to know why.
Essentially this code looks thru all of the form fields and if the input box
has a attribute of disabled="true", attribute would only be present if the
field was disabled, then the label field's class is changed to a grayed out
color.
--- The first problem seems to be with the v==true statement, I've tried
every variation I can think of but v==true is the only one that works in IE.
--- The second problem is the way IE & Netscape/Opera uses different class
attribute statements, is their a way of using 1 setAttribute statement that
will work in IE and Netscape as apposed to:
setAttribute("className", "xxx") for IE
and
setAttribute("class", "xxx") for Netscape
Any Help on these issues will be appreciated.
CES
function fDisableLable(){
for(var a = 0;a < document.forms.length;a++){
var fname = document.forms[a].name;
var f = document.forms[fname];
for(c = 0;c < f.length;c++){
var x = f.elements[c].id;
if(x!=""){
var v = f.elements[x].getAttribute("disabled")
var t = f.elements[x].getAttribute("type")
//This is where I'm having the problem
if((v==true)&&(t!="button")&&(t!="submit")){
//ie version
document.getElementById(x +
'Lable').setAttribute("className", "dataLable_TextDisabled");
//netscape version
document.getElementById(x +
'Lable').setAttribute("class", "dataLable_TextDisabled");
}
}
}
}
}