This is a migrated thread and some comments may be shown as answers.

Overriding the font color of textbox when disabled

3 Answers 404 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Web team
Top achievements
Rank 1
Web team asked on 13 May 2010, 10:06 AM
How can i override/change just the font color of disabled textboxes. I am using radformdecorator and windows7 skin? I find the current font color too light. Thanks.

3 Answers, 1 is accepted

Sort by
0
Petio Petkov
Telerik team
answered on 14 May 2010, 03:14 PM
Hi Arnold Castro,

You can use the .rfdTextbox input[type="text"][disabled] css class selector, e.g.
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .rfdTextbox input[type="text"][disabled]
        {
            color: red;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"
        Skin="Windows7" />
    <asp:TextBox ID="TextBox1" runat="server" Enabled="false">Some Text</asp:TextBox>
    <asp:TextBox ID="TextBox2" runat="server">Some Text</asp:TextBox>
    </form>
</body>
</html>
Let us know if you have any other questions.


Best wishes,
Petio Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Web team
Top achievements
Rank 1
answered on 17 May 2010, 03:09 AM
thanks for immediate reply however above code only works with chrome and safari. it doesn't work in IE8.
0
Petio Petkov
Telerik team
answered on 17 May 2010, 02:19 PM
Hi Arnold,

You can't style disabled elements under some browsers. The following quote is from W3C:
"How disabled elements are rendered depends on the user agent. For example, some user agents "gray out" disabled menu items, button labels, etc."
Let us know if you have any other questions.

Greetings,
Petio Petkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
FormDecorator
Asked by
Web team
Top achievements
Rank 1
Answers by
Petio Petkov
Telerik team
Web team
Top achievements
Rank 1
Share this question
or