Aug 30, 2012, 7:55 PM
[CLOSED] V2.1 FieldCls Change
Hi, is possible change the FieldCls client-side whit javascrip ?
I test this but not change the color of the background
Aurelio
I test this but not change the color of the background
<%@ 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></title>
<style type="text/css">
.green
{
background-color: Green !important;
background-image: none;
text-transform:uppercase;
}
.yellow
{
background-color: Yellow !important;
background-image: none;
text-transform:uppercase;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" Namespace="">
</ext:ResourceManager>
<ext:FormPanel ID="FormPanel1" runat="server" Region="Center" title="Test fieldCls">
<Items>
<ext:RadioGroup ID="rbArtTip" runat="server" FieldLabel="Background color" >
<Items>
<ext:Radio ID="rbStandard" runat="server" BoxLabel="Green" Checked="true" MarginSpec="0 0 0 -5" >
<Listeners>
<Change Handler="changeColorGreen();" />
</Listeners>
</ext:Radio>
<ext:Radio ID="rbTaglieColori" runat="server" BoxLabel="Yellow" MarginSpec="0 0 0 -70" >
<Listeners>
<Change Handler="changeColorYellow();" />
</Listeners>
</ext:Radio>
</Items>
</ext:RadioGroup>
<ext:TextField ID="txtColor" runat="server" FieldCls="green">
</ext:TextField>
</Items>
</ext:FormPanel>
<script type="text/javascript">
function changeColorGreen() {
if (rbStandard.checked) {
txtColor.fieldCls = "green";
}
};
function changeColorYellow() {
if (rbTaglieColori.checked) {
txtColor.fieldCls = "yellow";
}
}
</script>
</form>
</body>
</html>
Thanks Aurelio
Last edited by Daniil; Aug 31, 2012 at 2:46 PM.
Reason: [CLOSED]