Согласно документам jQuery UI Autocomplete ваш обработчик PHP должен возвращать данные в такой форме:
[
"NARAYAN SINGH CHUNDAWAT MLS",
"RADHESHYAM SARGRA RMCH 2",
// ...
]
или такая форма:
[
{ "label": "some label", "value": "NARAYAN SINGH CHUNDAWAT MLS" },
{ "label": "some label", "value": "RADHESHYAM SARGRA RMCH 2" },
// ...
];
// Note: should work with only the "value" key if you don't need the labels
Пример с использованием необработанных данных (я только что изменил соответствующий фрагмент кода):
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#gang").autocomplete({
source: [{
"value": "NARAYAN SINGH CHUNDAWAT MLS"
}, {
"value": "RADHESHYAM SARGRA RMCH 2"
}, {
"value": "TRILOK CHANDRA SUTHAR RMCH 2"
}, {
"value": "ASLAM KHAN"
}, {
"value": "BHARAT SINGH"
}, {
"value": "Bhrth Raj Mehta RMCH 2"
}, {
"value": "CHANDRA PAL SINGH"
}, {
"value": "Deepak sharma"
}, {
"value": "DEVI LAL KACHI"
}, {
"value": "GAANGA SINGH RATHORE"
}],
minLength: 3
});
});
</script>
<input type="text" class="form-control select_group product" style="text-transform: uppercase;" id="gang" name="gang" placeholder="Gangman Name" autocomplete="off">