I need a little bit help with JQuery UI Autocomplete. I want my textfield input.suggest-user
display names from an AJAX request. This is what I have:
jQuery("input.suggest-user").autocomplete({
source: function(request, response) {
var name = jQuery("input.suggest-user").val();
jQuery.get("usernames.action?query=" + name, function(data) {
// Ok, I get the data which looks like:
// ["[email protected]", "[email protected]","[email protected]"]
// But what now? How do I display my data?
test = data;
return test;
});
},
minLength: 3
});
Any help is very much appreciated.
source: "usernames.action"
. Your method should return a json array and should accept a parameter called "term". – Proptosis