On Wed, Feb 3, 2010 at 7:12 AM, Shinnuz <theangusyo...@gmail.com> wrote: > Database works, but if you see div#result doesn't update with "prova3"... > why? where i'm wrong?
I do believe your problem is you're creating the nation select AFTER you've set the handler for the select. Move your declaration of $('#sel_nazioni').change(function() into $.post("selection.php", {id_cont:cont}, function(data){, a la: $(document).ready(function() { $('#sel_continenti').change(function(){ var cont = $('#sel_continenti').attr('value'); $.post("selection.php", {id_cont:cont}, function(data){ $("#sel_nazioni").empty(); //$("div#result").empty(); $("div#nazioni").empty(); $("div#result").append("prova2<br />"); //$("div#result").append(document.createTextNode("prova")); $("#sel_nazioni").prepend(data); $("div#nazioni").prepend(data); $('#sel_nazioni').change(function(){ var id_naz = $('#sel_nazioni').attr('value'); $.post("result.php", {id:id_naz}, function(data){ $("div#result").empty(); $("div#result").append("prova3<br />"); //$("div#result").prepend(data); }); }); }); }); }); Nathan