I have this Json data that i would want to pass to JQuery.ui autocomplete
<input type="text" id="symptom_checker" name="search_symptom" />
JSON encoded data
var symptoms = [{"symptom_name":"Overall sensation of feeling unwell"},{"symptom_name":"cough"},{"symptom_name":"cough with blood mucus"}];
if i pass it to this function
$("#symptom_checker").autocomplete({
source: symptoms
});
when enter the symptom name it doesn't work, but if i try to use this json data
var symptoms = ["Overall sensation of feeling unwell", "cough", "cough with blood mucus"];
JQUERY
$("#symptom_checker").autocomplete({
source: symptoms
});
It works fine. How do I solve this ?