0
$(document).ready(function(){
$("#btnSend").click(function(){
$.ajax({
url:'@Url.Action("VerificaCep","ConsultaCep")',
type: "GET",
contentType:"application/json",
data: { cep: $("#txtCep").val() },
success: function (result) {
$("#divValor").html("<label>Endereço:" + result[0] + " Bairro:" + result[1] + " Cidade:" + result[2] + " Estado:" + result[3] + " </label>")
},
error: function(xhr, exception){
alert("Favor digitar o CEP!")
}
});
});
var Valor = document.getElementById('divValor.result[2]').innerHTML;
});
The script works correctly, I just can’t get the result of Array[2] for the Controller because I will do a search by client city. Excuse the question but I tried everything and nothing. Since thank you very much
– Joelias Andrade
Wouldn’t it just be, add in the date? Getting
data: { cep: $("#txtCep").val(),divvalor: $('#divValor').text() },
or something like that?– Luiz