Populate listbox/select with results from jQuery autocomplete
I am trying to populate a select or listbox control from the results in jQuery autocomplete plugin. I do not want to display the div开发者_运维百科 below the autocomplete control when the results are returned. Any help?
UPDATE: Here's the code I am trying to populate the listbox:
formatItem: function (data) {
$('#lstBox').append($("<option/>"), {
value: data.Name,
text: data.Name
});
return '';
}
Supposing you are using this plug in, have you tried:
$('input#suggest').setOptions({
max: 0
});
if that does not work try:
$('input#suggest').setOptions({
scrollHeight: 0
});
精彩评论