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

get_value of radtextbox returns empty

1 Answer 188 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jagat
Top achievements
Rank 1
Jagat asked on 29 Aug 2018, 07:10 PM

Hi,

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

Anything wrong with this code?

var addr1Text, addr2Text;
var Addr1 = $find("<%= txtAddr1.ClientID %>");
addr1Text = Addr1.get_value();
alert("Addr1Text: " +  addr1Text );
 
 <telerik:RadTextBox ID="txtAddr1" runat="server" OnTextChanged="txtAddr1_TextChanged" AutoPostBack="false">
                </telerik:RadTextBox>

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Aug 2018, 07:44 AM
Hi Jagat,

Please make that the control is already created on the page when trying to get reference to its client object: 

<script>
    function pageLoad() {
        var addr1Text, addr2Text;
        var Addr1 = $find("<%= txtAddr1.ClientID %>");
        addr1Text = Addr1.get_value();
        alert("Addr1Text: " + addr1Text);
    }
 
</script>
<telerik:RadTextBox ID="txtAddr1" runat="server" Text="Some content" AutoPostBack="false">
</telerik:RadTextBox>
 
You can find more details in this article: Get Client-side Reference to a Control Object.

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Jagat
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or