Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing font color for disabled box

Status
Not open for further replies.

flnMichael

Programmer
Nov 13, 2003
96
US
Hey,
Is it possible to change the font color for a disabled text box? I can change the background color and the font weight. I have yet to figure out whether or not I can change the color of the font.

Thanks
Mike
 

Have you tried this:

Code:
input.disabled {
  color: #FF0000;
}

and then when disabling your input, give it a class of "disabled":

Code:
myInputObj.disabled = true;
myInputObj.className = 'disabled';

I've not tried it, but then again, nor have you ;o)

Dan




 
I tried doing it like this:

Code:
<input style="color:#FF0000;" value="hello" disabled="disabled">

It didn't work (on IE6/Win). The text gets that "chiselled" look that Windows gives to disabled things. If you want to pick a colour, do this instead:

Code:
<input style="color:#FF0000;" value="hello" readonly="readonly">



-- Chris Hunt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top