Jquery library does not work correctly

0

I have this nested combobox that works with php and mysql:

<script language="javascript">

$(document).ready(function(){
   $("#bl3").change(function () {
	   //$("#bl3 option:selected").each(function () {
           $("#bl3").each(function () {
            elegido2=$(this).val();
            $.post("caso2.php", { elegido2: elegido2 }, function(data){
            $("#cliente").html(data);
			
            });            
        });
   })
});


</script>

The problem that I have is that, in my machine it runs well, but in the client's machine he pulls the data but also pulls a blank box and does not select the data in the second box automatically.

    
asked by Leonardo Rodríguez 02.05.2018 в 07:28
source

1 answer

0

because the problem of validation of empty fields was already identified. You can do it using if to verify that it does not go in null also make sure when sending to use trim() to avoid the escape of blank spaces.

    
answered by 02.05.2018 в 18:39