I have a problem that is as follows:
In my system I have a combo that serves as a parameter to load (via ajax) a second combo, this works normally.
Then, when clicking on an item in a table, the first combo is updated and based on the selected combo item it loads a second combo.
But it does not work!
I have already used jquery on / live / bind, but it does not work
follow the code:
$ ('. tableLineCargo'). live ('click', fillFormularioCargo); $ ('# responsavelcombo'). on ('change', listAlvos);
function listarAlvos(){
var dados = {
acao: 'combo',
nome: alvo
};
var vurl;
var respcombo = $('#responsavelcombo').val();
if (respcombo == 0){
$('#alvocombo').html("");
}else{
if (respcombo == 1){vurl = 'associacaocrud.php';}
if (respcombo == 2){vurl = 'grupocrud.php';}
if (respcombo == 3){vurl = 'regiaocrud.php';}
if (respcombo == 4){vurl = 'templocrud.php';}
$.ajax({
url: vurl,
type: 'POST',
data: dados,
success: function(retorno){
$('#alvocombo').html(retorno);
}
});
}
};