0
I have the following HTML
<select id="id_cliente">
<option value="1">CLIENTE 1</option>
<option value="2">CLIENTE 2</option>
<option value="3">CLIENTE 3</option>
</select>
I own the following jQuery:
$("#id_cliente").change(function(){
var id_cliente = $("#id_cliente").val();
$.ajax({
type: "POST",
url: "contrato/buscar_cliente",
data: {id_cliente:id_cliente},
success: function(data){
$("#nome").data[nome];
$("#telefone").data[telefone];
$("#email").data[email];
alert(data);
}
});
});
And the function of seeking the customer:
public function buscar_cliente(){
$this->db->where("id_cliente", $_POST['id_cliente']);
print_r($this->db->get("clientes")->row());
}
I know the way I did, it doesn’t work... My question is:
How do I display the return data inside an input? Example: You will return me: Name, Phone, Email...
<input type="text" id="nome" value="">
<input type="text" id="telefone" value="">
<input type="text" id="email" value="">
What is the console output.log(date)?
– Marconi