<input type="hidden" id="id_location_hidden" val="">
请检查此代码,希望它能帮助您。
$("#srch_term").autocomplete({ source: url, select: function( event, ui ) { event.preventDefault(); $("#id_location_hidden").val(ui.item.id); } });