Imagine a json file with the following data:
[
{
color: \"red\",
value: \"#f00\"
},
{
color: \"green\",
value: \"
$(function() {
$("#subject_name").autocomplete({
source: function(request, response) {
$.ajax({
url: "api/listBasicsubject",
dataType: "json",
type: "POST",
data: {
subject_name: request.term,
},
success: function(data) {
response($.map(data.data, function(item) {
return {
label: item.subject_name,
value: item.subject_name
}
});
}
},
autoFocus: true,
minLength: 1
});
});
});