I want to use the autocomplete menu for a textbox, but instead of having to type something before you get results, i want the menu to pop up with all available options first on focus, then narrow as you type.
The problem is i tried the focus but with no success:
here is my code:
var neighborhood_name = ["LA","NW","SE","GF"];
var statuses = [];
$(document).ready(function() {
BindControls();
});
function BindControls() {
$('#services').autocomplete({
source: neighborhood_name,
minLength: 0,
scroll: true
}).focus(function() {
$(this).autocomplete("search", "");
});
}
I'm using the follwing jQuery
https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css
https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.js
Whenever I click on my input i get the following error: $(...).autocomplete is not a function on focus, althought it works when I start typing something but not when I want to see the full list. \
Any clues?
Thanks!