开发者

Populate listbox/select with results from jQuery autocomplete

开发者 https://www.devze.com 2023-02-04 03:32 出处:网络
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

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
});
0

精彩评论

暂无评论...
验证码 换一张
取 消