Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

crie 3 lista suspensa dependente usando php ajax mysql


Erro com seu código ajax em javascript tente isso



$(document).ready(function(){
$('#site_name').change(function(){

     var  arrayID    = $(this).val().split(",");
     var  ownerID    = arrayID[0];
     var  companyID  = arrayID[1];

     if(ownerID != "" && companyID != ""){

             $.ajax({
                url:"<?php echo get_stylesheet_directory_uri(); ?>/dropdown_fetch_owner.php",
                method:"POST",
                data:{ownerID:ownerID},
                datatype:"text",
                success:function(data){
                    $('#owner_name').html(data);
                }

             });

             //depend company name on site name 
             $.ajax({
                url:"<?php echo get_stylesheet_directory_uri(); ?>/dropdown_fetch_owner.php",
                method:"POST",
                data:{companyID:companyID},
                datatype:"text",
                success:function(data){
                    $('#Company_name').html(data);
                }

             });
    }


  });

});