Edit this page

OnClientTextChanged

The OnClientTextChanged client-side event occurs when the text currently present in the input area is changed and RadAutoComplete has lost its focus.

The event handler receives two parameters:

  1. The instance of RadAutoCompleteBox firing the event.

  2. An eventArgs parameter containing the following method:

  • get_text() - returns the text currently present into the input area.
important

The OnClientTextChanged client-side event is fired only when the input type of RadAutoCompleteBox is set to " Text ".

This event is used in scenarios when operations need to be preformed to RadAutoCompleteBox right after the text in the input area has been changed.

<script type="text/javascript">
    function textChanged(sender, eventArgs) {
        alert("The text currently present in the input area of RadAutoCompleteBox is: " + eventArgs.get_text());
    }
</script>
<telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="RadAutoCompleteBox1" OnClientTextChanged="textChanged"
    DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="ID" InputType="Text">
</telerik:RadAutoCompleteBox>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikVSXConnectionString %>"
    SelectCommand="SELECT [ID], [CountryID], [Name] FROM [Cities]"></asp:SqlDataSource>

See Also