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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabled Text Area and CSS

Status
Not open for further replies.

djabell

Instructor
Apr 9, 2001
44
0
0
GB
I've got an HTML page with a standard textarea on it, which is disabled to stop users editing the text. I've changed the state of the textarea to disabled and as expected, the text appears grey in IE7. Thinking it would be a straight forward task to modify the default text colour, I created a simple textarea class to change the colour of the text to make it clearer but this has no effect in IE7, though FireFox 2.0.0.14 displays it perfectly. Is there anyway to 'fudge' IE into displaying the text. I'd rather not use javascript to do this, if at all possible.
 
No. Some browsers apply their own special style on the disabled elements and there's no rule to override this style.

You could use readonly attribute instead of the disabled. That disallows changes to the textarea but does not change the styling.

However, I do believe that readonly attribute is not properly supported in IE6. Not sure about IE7 though.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Cheers. That works fine. Interestingly, it works in IE6, IE7 and FireFox. What do you mean when you say IE6 doesn't support readonly properly?
 
I thought IE6 still allowed editing of readonly elements. Maybe I was thinking an earlier browser still. Haven't worked with readonly elements in a while.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top