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

Add or remove an attribute from RadTextBox client-side

3 Answers 220 Views
Input
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 02 May 2014, 09:20 PM
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.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 May 2014, 12:47 PM
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.
0
Brian
Top achievements
Rank 1
answered on 06 May 2014, 12:55 PM
I guess what I'm really asking is if it's safe to access the _textBoxElement property for use in jQuery expressions.
0
Shinu
Top achievements
Rank 2
answered on 07 May 2014, 06:16 AM
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.
Tags
Input
Asked by
Brian
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brian
Top achievements
Rank 1
Share this question
or