how return a second value from autocomplete function?
Hello !
sorry for my English.
I am new to ajax and jquery, as I can return a second value of the autocomplete function?
the script
<script type="text/javascript">
$("#nombre").autocomplete("<?php echo base_url()?>transportistas_controller/autocomplete_partidos");
$("#nombre").blur(function(){
window.opener.$("#partidonum").val($(this).val());
window.close();
});
</script>
the function
function autocomplete_partidos() {
$nombre = $this->input->post('q');
$this->db->order_by('cDes');
$this->db->limit(10);
$this->db->like('lower(cDes)', strtolower($nombre), 'both');
$partidos = $this->db->get("cerepartidos")->result();
foreach ($partidos as $partido) {
echo "$partido->cDes - $partido->cCod\n";
}
}
}