views:

31

answers:

3

how to set the font color of an input box which is disabled (IE only)

A: 

You can't do this with CSS, because older versions of IE don't have the necessary support.

Your best bet is to use a Javascript work-around. When the input box is disabled, run a script to change the class name, and style the text colour differently on that new class name. If the input box is re-enabled, use a similar script to change the class name back to what it was originally.

This is sort of discussed here: http://codingforums.com/showthread.php?t=147842

Dan M
A: 

It depends of what you need but you may trick that using the readonly property on the input, making the background grey and the typo the way you want with CSS.

But, for example, if you use it in a form and PHP, with disable, the variable isn't sent, with readonly, it is... It might be a problem.

Chouchenos
A: 

IE uses system controls for form fields. You can't change them from the CSS. You would have to pack inputs in divs and make the inputs transparent. And don't use HTML disabled attribute then, but disable it with javascript.

For better results - find a jquery plugin for doing good looking inputs.

naugtur