This is a migrated thread and some comments may be shown as answers.

RadTextBox clientevent OnBlur does not work

1 Answer 82 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 25 Jun 2014, 08:17 PM
Hi,
I have in  my html RadTextBox:

<telerik:RadTextBox ID="ShrtgLicAreaTextBox" runat="server" TabIndex="2" Width="300px" CssClass="textbox" MaxLength="40" Height="15px" onKeyUp="Count(this,40)" onChange="Count(this,40)" FocusedStyle-BackColor="#D4DEEC" >
<ClientEvents OnBlur="OnBlur" />

Here is my js for OnBlur event:

<script type="text/javascript">
function OnBlur(sender) {
sender.get_styles().EnabledStyle[0] += "background-color:#FFCC99;";

}
</script>

Bur for some reason when I leave textbox background color is not changing looks like OnBlur event does not work.

Thank so much for yuor help.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Jun 2014, 04:56 AM
Hi Vitaly,

Please do the following modification in your JavaScript code snippet which works fine at my end.

JavaScript:
function OnBlur(sender) {
    sender.addCssClass("txt-color");
}

CSS:
.txt-color
{
    background-color : Black !important;
}

Thanks,
Shinu.
Tags
General Discussions
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Shinu
Top achievements
Rank 2
Share this question
or