How to display via JQUERY more JSON data -
i'd code http://af-design.com/blog/tag/autocomplete/ use json. i've code works fine dont how solve task , event use.
i'd insert text fields values json response. user started typing, clicked on item , info should inserted text fields. when user changed item in autocomplete data must updated also.
// $('#infogistype').val(item.gis_type); // $('#infogislocationid') val(item.location_id); $('#gisname').autocomplete({ source: function(request, response) { $.getjson("autocomplete.php", { term: request.term }, function(result) { response($.map(result, function(item) { return item.name; })); }); },
how can it?
[{"name":"kiev","location_id":"3","parent_id":"0","gis_type":"region"}, {"name":"kiev metro","location_id":"200","parent_id":"17","gis_type":"city"}]
Comments
Post a Comment