how to get RadAutoCompleteBox DataValueField value from javascript?

2 posts, 0 answers
  1. Ravi
    Ravi avatar
    14 posts
    Member since:
    Jul 2014

    Posted 10 Aug 2016 Link to this post

    I am not getting the DataValueField from AutoCompleteBox using JAVASCRIPT.

    I am getting the Text name of the field but not there ID/Value.\

    i go thru various Telerik post ,i founf get_value() function but  when i am using it dosn't work.

    suggest me the what can i do.

    <p> function textChanged(sender, eventArgs) {</p>
    alert("The text currently present in the input area of RadAutoCompleteBox is: " + eventArgs.get_text());<br>

    this textChanged function i put on

    <telerik:RadAutoCompleteBox RenderMode="Lightweight" ID="txtPatient" runat="server" Filter="Contains" Width="100%"<br>InputType="Text" DataValueField="MTPatientID" DataTextField="Patient" EmptyMessage="Select Patient" WebServiceSettings-Method="BindAllpatient" MinFilterLength="4" OnClientTextChanged="textChanged"><br> <WebServiceSettings Method="GetCompanyNames" Path="QAFileProcess.aspx" /><br>                                <TextSettings SelectionMode="Single" /><br></telerik:RadAutoCompleteBox>


    please suggest me how can i find the value.

  2. Nencho
    Nencho avatar
    1665 posts

    Posted 15 Aug 2016 Link to this post

    Hello Ravi,

    In order to get the value of the given entry at this event, you need to get a reference to the Entry and then use the get_value() method:

               function textChanged(sender, eventArgs) {
                   var value = sender.get_entries().getEntry(0).get_value();
                   alert("The text currently present in the input area of RadAutoCompleteBox is: " + value);

    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top