I have the following jQuery:
function clienteChange() {
var id = $('#idCliente').val();
$.ajax(
{
url:"/Administrar/clientes.endereco.php?id=" + id,
dataType : 'json',
success:function(result) {
$('[name^="cham_endereco[]"]').val(result.endereco);
$('[name^="cham_numero[]"]').val(result.numero);
$('[name^="cham_bairro[]"]').val(result.bairro);
$('[name^="cham_cidade[]"]').val(result.cidade);
}
});
var selectSolicitante = jQuery(id).parents('tr').find('select.selectSolicitante');
selectSolicitante.html('<option value="0">Carregando...</option>');
$.post("/Administrar/clientes.solicitante.php?idCliente=" + id,
{solicitante:jQuery(id).val()},
function(valor){
selectSolicitante.html(valor);
}
);
}
The first block works correctly, it shows the data right in the address, number ... I wanted to select the client, execute that first block but also execute the second block, searching for the prerequisite applicants ... I did the test, but does not work.
Follow PHP as well:
mysql_query("SET NAMES 'utf8'");
mysql_query('SET character_set_connection=utf8');
mysql_query('SET character_set_client=utf8');
mysql_query('SET character_set_results=utf8');
echo "<option>teste</option>";
The signup screen is this: