php - using json object data in jquery select -
{"names": [ {"patientname": "ratna"}, {"patientname": "raju" }, {"patientname": "krishna"}, {"patientname": "kishore"}, {"patientname": "kishore1"}, {"patientname": "mahesh"} ]} this json object i'm getting ajax call want add patientname values select box through jquery
can 1 tell me how accomplish ??
here i'm using $.ajax() function ajax call
thanks in advance
var select = $('#selectid'); $.each(data.names, function(i, v){ select.append('<option value="'+v.patientname+'">'+v.patientname+'</option>'); }
Comments
Post a Comment