I have the following ajax
:
var id = $('#idCliente').val();
$.ajax(
{
url:"/Administrar/chamadas/ajax/endereco/" + id,
dataType : 'json',
success:function(result) {
$('[name^="cham_endereco[]"]').val(result.endereco);
$('[name^="cham_numero[]"]').val(result.numero);
$('[name^="cham_cidade"]').val(result.cidade);
$('[name^="cham_bairro"]').val(result.bairro);
}
});
In this case I retrieve the client address data, to automatically populate the fields, the return is as follows:
{"address": "R MANDAGUARI "," Neighborhood ":" 25 "," City ":" 1 "," Status ": 16," CEP ": 83324410," Number ":" 1316 "
Until the return, all right. However, in the system I use a select to first select the city and then yes the neighborhood ... In this case, select the city automatically, however, the neighborhood is not selected (because it is not loaded by an ajax).
How can I call the neighborhood in ajax, so that it automatically loads on the screen and select the neighborhood that is being requested?