I have the following script:
$("#tp_pagamento").change(function(){
var tp_pagamento = $(this).val();
$.ajax({
url: BASE_URL + "ajax/lista_integrador",
type: "POST",
data: {tp_pagamento:tp_pagamento},
success: function(data){
$('.tp_integradora').html("<select id=\"tp_integradora\" name=\"tp_integradora\" class=\"form-control\"><option value='0'>Carregando...</option></select>");
setTimeout(function(){
$('.tp_integradora').html(data);
},1000);
}
});
});
$("#tp_integradora").change(function(){
var tp_integradora = $(this).val();
alert(tp_integradora);
if(tp_integradora==1){
$("#logo_integradora").html("<img src="+ BASE_URL + "/assets/images/integradora-cielo.jpg>");
}
});
My idea is that: When selecting tp_payment, look for the available ones and list them in another select, and this does, however, I need to select the next select, it has no action ... How can I get the data from the select that was displayed on the screen?