Undefined Results in jQuery Autocomplete
- by CreativeNotice
So I've got the latest versions of jQuery and UI running.
I'm using the basic autocomplete invocation and returning valid JSON (validated via JSONLint).
$("input#cust_id").autocomplete({
source: yoda.app.base + "/assets/cfc/util/autocomplete.cfc?method=cust",
minLength: 2,
select: function(event, ui) {
log(ui.item ? ("Selected: " + ui.item.value + " aka " + ui.item.id) : "Nothing selected, input was " + this.value);
}
});
Both the value and label elements of the returned array show up in the list as undefined.
I can watch the results returned via Firebug and the JSON is correct there as well. Also, while the list only says "undefined" it does say that the same number of times as records returned in JSON.
[{"VALUE":"custid1","LABEL":"My Customer Name 1"},{"VALUE":"custname2","LABEL":"My customer name 2"}]