Read value of telerik radtextbox injavascript


I am trying to read the value of the radtext box. It comes out empty.

Anything wrong with this code?

var Addr1 = $find("<%= txtAddr1.ClientID %>");
addr1Text = Addr1.get_value();
alert("Addr1Text: " +  addr1Text );

 <telerik:RadTextBox ID="txtAddr1" runat="server" OnTextChanged="txtAddr1_TextChanged" AutoPostBack="false">

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chinmay PatelChief Technology NinjaCommented:
Hi shahJagat,

When you are executing your code? It looks bit odd. You have OnTextChanged but then AutoPostback is false.

As such, I would put a debug point above var Addr1 and check if I am actually getting the reference to underlying RadTextBox or not.
Your API usage get_value() is correct but we will have to see when you are executing the JavaScript.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shahjagatAuthor Commented:

txtAddr1 is part of an address control(user control which also has addr2, city state)
When the onclientselectedindexchanged event of the radcombobox is fired, i want to capture all the values.
In this scenario, i can read the values of the city and state comboboxes. I am not able to get the value of the text box.

Chinmay PatelChief Technology NinjaCommented:
Hi Shahjagat,

Please post complete code, if possible, otherwise it is difficult to guess. Check your Browser's console, are you getting any errors? Also did you try putting a debug point and see what you are getting in Addr1?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.