Add or remove an attribute from RadTextBox client-side

4 posts, 0 answers
  1. Brian
    Brian  avatar
    7 posts
    Member since:
    Nov 2011

    Posted 02 May 2014 Link to this post

    I'm doing some work in a javascript function and part of it is to remove (or add) an attribute from a RadTextBox.  Looking at the list of properties and methods on the Client Object page, I don't see how to do this.  I've seen forum posts reference the _textboxelement property of RadTextBox control like so:

    <script type="text/javascript"
        function setToolTip() { 
            var RadTextBox = $find("<%= RadTextBox1.ClientID %>");  // Get the textbox client object 
            RadTextBox._textBoxElement.title = "Changed Tooltip"
        
    </script>

    I was wondering if this would work.  If so, how?

    I'm trying to add or remove the data-bind attribute on a textbox.

    Thanks.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 May 2014 in reply to Brian Link to this post

    Hi Brian,

    In order to change the ToolTip for a RadTextBox first you need to access the TextBoxElement. This will return HTML element for the TextBox and by changing the title value it will change the ToolTip of RadTextBox. Please elaborate your requirement if it doesn't help.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Brian
    Brian  avatar
    7 posts
    Member since:
    Nov 2011

    Posted 06 May 2014 in reply to Shinu Link to this post

    I guess what I'm really asking is if it's safe to access the _textBoxElement property for use in jQuery expressions.
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 May 2014 in reply to Brian Link to this post

    Hi Brain,

    The title attribute  will change the tooltip of all the controls. As far as I know there is no issue with the _textBoxElement. The _textBoxElement is a property, which is normally for internal use, that's why it is not documented officially. In order to change the title one suggestion is that you can access the get_element() property and change the title and another suggestion is to change it by _textBoxElement.

    Thanks,
    Shinu.
Back to Top