Autocomplete scroll question -- how to?
Hi all,
I have an autocomplete list that looks like this:
- <script>
$(document).ready(function() {
$("#tags").autocomplete({
source: [{label:"1167860", value:"3711"},{label:"608712",value:"3731"},{label:"1167861",value:"3712"},{label:"608711",value:"3732"},{label:"1167863",value:"3713"},{label:"608714",value:"3735"}],
highlight: false
});
$("#tags").bind( "autocompleteselect", function(event, ui) {
var label= ui.item.label;
var id= ui.item.value;
alert("label: " + label + " id: " + id);
});
- });
</script>
The autocomplete works fine, but when I scroll through the list, the value of the jSON object is displayed in the input box. This seems like it would confuse my users. How to display label in the input box but have the item value available on select?