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

Stop RadTextbox from clearing text on focus?

2 Answers 126 Views
Input
This is a migrated thread and some comments may be shown as answers.
Kevin Price
Top achievements
Rank 1
Kevin Price asked on 15 Dec 2010, 08:34 PM
I have a RadTextBox that is having its value attribute set via javascript/ajax call $telerik.$.get. This works great except that when the control receives focus, the text is erased??? How can I turn this off? There is no code set for the onfocus event.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2010, 07:45 AM
Hello Kevin,


I am not sure about how you set the RadTextBox value from client. The set_value() method is used to set textbox value from client.

You can find remaining most important client methods by going through the following link.
RadTextBox Client Object



-Shinu.
0
Kevin Price
Top achievements
Rank 1
answered on 16 Dec 2010, 01:48 PM
Thanks Shinu. The problem is that for some reason, $find isn't returning the object - always null. getElementById works - and while allowing me to set the value via setAttribute(value, ...), it seems that even though the value is set (because text appears in the textbox) its value really isn't set. I have other objects in the same page that $find is working for perfectly and have tried quite a few ways/places to access this object with the same result. I know the ID is valid because ClientID returns a valid value. I think I'll add this to a support ticket as regardless, you'd think that you could work with these objects using standard javascript methods ???

UPDATE: Figured it out.
I did not realize when you use RadTextBox that 2 textboxes are created and that the value is actually set on the hidden object. Problem solved.
Tags
Input
Asked by
Kevin Price
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kevin Price
Top achievements
Rank 1
Share this question
or