title | page_title | description | slug | tags | published | position |
---|---|---|---|---|---|---|
OnClientTextChanged |
OnClientTextChanged - RadAutoCompleteBox |
Check our Web Forms article about OnClientTextChanged. |
autocompletebox/client-side-programming/events/onclienttextchanged |
onclienttextchanged |
true |
8 |
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:
-
The instance of RadAutoCompleteBox firing the event.
-
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>
- [Overview]({%slug autocompletebox/client-side-programming/overview%})