[CLOSED] V2.0 TextField background

  1. #1

    [CLOSED] V2.0 TextField background

    Hi, how do you change the background color of a textField?
    <ext:TextField ID="txtGruAziCod" runat="server" AllowBlank="false" X="10" Y="50" 
                                            BlankText="*Obbligatorio" FieldLabel="Codice" LabelWidth="60"                                         
                                            MaxLength="8" MaxLengthText="*Massimo 8 caratteri."  FieldCls="colorBack">
    I have in css style the .colorBack, but the backgroud color of the textfied is always white. I have test all the property Cls, but the result is always white.

    Tnks

    Aurelio
    Last edited by Daniil; Jan 16, 2012 at 8:38 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Please post the css you are using. This should be the .colorBack class definition.
    Geoffrey McGill
    Founder
  3. #3
    Hi geoffrey , i usign this css

     .colorBack
        {
            background-color:yellow;
        }
    but i have noticed now that reproduces an error the field turns yellow background

    Click image for larger version. 

Name:	Img01.png 
Views:	147 
Size:	879 Bytes 
ID:	3706

    this is then no error, you may notice a yellow line under the text..but the background is white..

    Click image for larger version. 

Name:	Img02.png 
Views:	141 
Size:	1.1 KB 
ID:	3707

    this is when a error, the background is Ok yellow..

    Tnks Aurelio
  4. #4
    Hi, Geoffrey

    I solved, the problem was the css, this work OK

    .colorBack
        {
            background:yellow;
        }

    thanks for your excellent work

    Aurelio
  5. #5
    Or this one:
    .backColor {
        background-color: yellow;
        background-image: none;
    }
  6. #6
    Generally, a custom FieldCls overrides the default one.

    I would suggest you to set up the Cls property instead of the FieldCls one.
    http://forums.ext.net/showthread.php...ll=1#post72556

    Here is the example with a TextField.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET v2 Example</title>
        <style type="text/css">
            .my-dateField INPUT {
                background-color: #FDFCD9;
                background-image: none;
            }
        </style>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:TextField 
            runat="server" 
            Cls="my-dateField" />
    </body>
    </html>

Similar Threads

  1. TextField Background
    By mrd in forum 1.x Help
    Replies: 3
    Last Post: Feb 27, 2012, 12:06 PM
  2. [CLOSED] BackGround TextField
    By majunior in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 19, 2011, 6:48 PM
  3. Dynamically change textfield background color
    By VALUELAB in forum 1.x Help
    Replies: 0
    Last Post: Mar 04, 2011, 4:50 PM
  4. [CLOSED] the css background-color:Transparent does not work for TextField
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 10, 2010, 3:17 PM
  5. Replies: 2
    Last Post: May 20, 2009, 3:21 PM

Posting Permissions