PDA

View Full Version : [CLOSED] V2.0 TextField background



Aurelio
Jan 15, 2012, 3:10 AM
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

geoffrey.mcgill
Jan 15, 2012, 5:03 AM
Hi,

Please post the css you are using. This should be the .colorBack class definition.

Aurelio
Jan 15, 2012, 5:37 PM
Hi geoffrey , i usign this css


.colorBack
{
background-color:yellow;
}

but i have noticed now that reproduces an error the field turns yellow background

3706

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

3707

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

Tnks Aurelio

Aurelio
Jan 15, 2012, 5:43 PM
Hi, Geoffrey

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


.colorBack
{
background:yellow;
}


thanks for your excellent work

Aurelio

Daniil
Jan 16, 2012, 9:38 AM
Or this one:

.backColor {
background-color: yellow;
background-image: none;
}

Daniil
Jan 16, 2012, 9:46 AM
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?16926&p=72556&viewfull=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>