I have this code :
var myList = [ "Avellino", "Enna", "Frosinone" ];
myInput.autocomplete({
source: function(request, response) {
var data = $.grep(myList, function(value) {
return value.substring(0, request.term.length).toLowerCase() == request.term.toLowerCase();
});
response(data);
},
appendTo: "#myDiv"
});
and I'd like, when I click on the input box, show the list of all elements (with the same autocomplete box for choose value) of myList
.
I suppose I need a third part handler, like :
myInput.focus(function () {
});
but I don't know how to dialogate with the autocomplete. Any ideas/solutions?