Overriding the font color of textbox when disabled

4 posts, 0 answers
  1. Web team
    Web team avatar
    57 posts
    Member since:
    Mar 2010

    Posted 13 May 2010 Link to this post

    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.
  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 14 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Web team
    Web team avatar
    57 posts
    Member since:
    Mar 2010

    Posted 16 May 2010 Link to this post

    thanks for immediate reply however above code only works with chrome and safari. it doesn't work in IE8.
  5. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 17 May 2010 Link to this post

    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.
Back to Top