I use this script for autocomplete...
$('#custmoers_name').autocomplete({
source: function (request, response) {
// $.getJSON("<?php echo base_url('index.php/Json_cr_operation/autosearch_custmoers');?>", function (data) {
$.getJSON("Json_cr_operation/autosearch_custmoers?term=" + request.term, function (data) {
console.log(data);
response($.map(data, function (value, key) {
console.log(value);
return {
label: value.label,
value: value.value
};
}));
});
},
minLength: 1,
delay: 100
});
My json return :- [{"label":"Mahesh Arun Wani","value":"1"}]
after search m
but it display in dropdown [object object]
...