$('#autocomplete-form').autocomplete({
maxHeight: 200, //you could easily change this maxHeight value
lookup: array, //the array that has all of the autocomplete items
onSelect: function(clicked_item){
//whatever that has to be done when clicked on the item
}
});
new autoComplete({
selector: 'input[name="name_of_searchbox"]',
minChars: 1,
source: function(term, suggest){
term = term.toLowerCase();
var choices = [];
var matches = []; //For Pushing Selected Terms to be always visible, can be adapter later on based on user searches
for (i=0; i<choices.length; i++)
if (~choices[i].toLowerCase().indexOf(term)) matches.push(choices[i]);
suggest(matches.slice(0,10));
}
});