ClientEvent for "X" in RadTextBox?

2 posts, 0 answers
  1. john81
    john81 avatar
    36 posts
    Member since:
    Jan 2010

    Posted 22 May 2014 Link to this post

    When a RadTextBox has text in it, a "X" is rendered at the right side of the textbox that clears out the text in the textbox when clicked.  Is there a ClientEvent for clicking on the "X"?  I'd like to disable a button when the "X" is clicked.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 May 2014 in reply to john81 Link to this post


    As far as my knowledge RadTextBox doesn't have any Button inside the TextArea. In order to achieve your scenario you have to add an external button inside the TextBox as follows.

    <telerik:RadTextBox ID="RadTextBox1" runat="server" Skin="" CssClass="MyTextBox"
        Width="120px" />
    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="http://i.imgur./z7ZSYjt.png"  OnClientClick="Close(); return false;"  CssClass="MyImageButton"  />

    <style type="text/css">
            border: 1px solid blue;
            width: 150px;
            height: 20px;
            margin-left: 1%;
            vertical-align: middle;

    <script type="text/javascript">
        function Close() {
            var imageButton = document.getElementById("ImageButton1");
            var radTextbox = $find("<%=RadTextBox1.ClientID %>");
            //Your code

Back to Top