OnBlur event does not work for radtextbox

2 posts, 0 answers
  1. Vitaly
    Vitaly  avatar
    73 posts
    Member since:
    Aug 2011

    Posted 27 Jun 2014 Link to this post

    Hello,
    please help me to resolve this issue.
    As Shinu suggested to use this logic for OnBlur event:

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

    javascript:

    function changeTextBoxColorOnBlur(sender, args) {
    sender.addCssClass("txtblur-style");


    }

    CSS:

    .RadComboBox_Default .rcbFocused .rcbReadOnly .rcbInput, .riSingle .riTextBox[type="text"]:focus
    {
    background-color:Red !important;
    }
    .txtblur-style
    {
    background-color:Blue !important;
    }

    But when I move away from control using tab key the color not changing to blue as it supposed to do.

    RadTextBox is located inside RadPanelBar:

    <telerik:RadPanelBar ID="formPanel2" runat="server" Width="98%" ExpandMode="MultipleExpandedItems" OnClientItemClicking="onPanelItemClicking" Skin="Telerik" >
    <Items>
    <telerik:RadPanelItem Expanded="true" Text="REQUEST FORM" runat="server" Selected="true" Font-Bold="true" Font-Size ="13" Font-Names ="Verdana">
    <Items>
    <telerik:RadPanelItem Value="infoPanel" runat="server" Height="75">
    <ItemTemplate>
    <div style="padding: 5px;background-color :#FAFCFE;">
    <telerik:RadTextBox ID="NameTextBox" runat="server" TabIndex="-1" Width="300px" CssClass="textbox" ReadOnly="true" Height="15px" >


    <table width="98%" >
    <tr>
    <td style="width:24%;">
    <label class="style">
    6. SHORTAGE LICENSE AREA:
    </label>
    </td>
    <td >
    <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="changeTextBoxColorOnBlur" >
    </telerik:RadTextBox>
    <asp:Image ID="ShrtgLicErrImage" runat="server" Width="14px" Height="14px" ImageUrl="~/Image/error-icon.jpg" ImageAlign="Middle" Visible="false" />
    </td>

    </tr>
    </table>

    Please help...
    Vitaly  
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Jun 2014 in reply to Vitaly Link to this post

    Hi Vitaly,

    I have answered for your question in this forum. Let me know if you have any concern.

    Thanks,
    Shinu.
Back to Top