views:

160

answers:

1

$(document).ready(function() {

     $("#ddlprod").change(function() {

        var pk= $("#ddlprod").val();

        $.ajax({

        url: "ajaxprintdropdown.php",

        type: "POST",

        data: 'pk='+pk,

        timeout: 5000,

        success:  function(output) {                            

            $('#divtesting').show();    //works well            
            $('#divtesting').html(output);   //works well
        },


        }); 


     $("#ddltesting").change(function(){
        alert('a');    //not functioning at all
        var c= $("#ddltesting").val();
        alert(c);   //not functioning at all    
      });



     });

ajaxprintdropdown.php's output

<select name=ddltesting id=ddltesting >
<option value=''>--Select--</option>
<option value='test1'>bla for test1</option>
<option value='test2'>bla for test2</option>
</select>

Jquery not working for multi level dependency? $("#ddltesting").change(function(){ no response at all

+3  A: 
rahul
-1 -- jQuery 1.4 live() handles change -- I'll knock it back up as soon as that's correct as 1.4 is the current version.
altCognito
see http://www.neeraj.name/blog/articles/893
altCognito
$("#ddltesting").live ( "change" , function(){ var c= $(this).val(); $("#sampletextbox").text(c); //live change bind works for var c, but not for #sampletextbox...});
i need help