March 10, 2013
trigger function from autocomplete input selection
Question by Bwyss
I have an input field that will autocomplete an address, I want an address selection to trigger a function.
html
Address: <input id="searchTextField" type="text" autocomplete="on" runat="server" />
JS
$('input[searchTextField]').bind('autocompleteSelect', function() {
// some code...
});
I feel like I’m not anywhere close with the above…
Answer by Starx
I think you are trying to do this.
$("#searchTextField" ).autocomplete({
change: function( event, ui ) {
// The code you want after selection is made
}
});