PDA

View Full Version : [CLOSED] Changing the Textfields CSS



Peter.Treier
May 05, 2013, 2:11 PM
Hi all

In need to mark some Textfields with a green Border.
I think about this CSS


.withConfirmationsCode {
border-color: green;
}

Which Method can I use to apply the CSS ?

Peter

Baidaly
May 05, 2013, 9:28 PM
Hello!

You can apply it in this way:


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head runat="server">
<style>
.withConfirmationsCode {
border-color: green;
}
</style>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:TextField runat="server" FieldCls="withConfirmationsCode"></ext:TextField>
</body>
</html>

Peter.Treier
May 06, 2013, 7:34 AM
<ext:TextField runat="server" FieldCls="withConfirmationsCode"></ext:TextField>


And from Java Script ?

Peter

Daniil
May 06, 2013, 8:11 AM
Hi,

In that case I would use the Cls property and addCls/removeCls methods.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>

<html>
<head runat="server">
<style>
.withConfirmationsCode input.x-form-text {
border-color: green;
}
</style>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:TextField ID="TextField1" runat="server" Cls="withConfirmationsCode" />

<ext:Button runat="server" Text="Add" Handler="App.TextField1.addCls('withConfirmationsCode');" />

<ext:Button runat="server" Text="Remove" Handler="App.TextField1.removeCls('withConfirmationsCode');" />
</body>
</html>