Skip to content Skip to sidebar Skip to footer

Jquery Dropdown From Mysql Based On Previous Selection

EDIT 2 Seemed it was a problem with a CSS class. EDIT Strange enough it works on the public side of the site by not the priviate. It must be a css or conflict with another plugin.

Solution 1:

I'd suggest using .empty() instead of .remove() as that way you actually only delete the children of that element instead of the element itself.

success:function(data){ 
    var select = $('#manager_name');
        select.empty();

        $.each(data, function(index, array) {
               select.append(new Option(array['first_name']+ " "+array['last_name'],array['id']));
        })
},

I personally haven't used the new Option method, so I can't verify that it's correct.

A working solution should be http://jsfiddle.net/HffLg/10/


Post a Comment for "Jquery Dropdown From Mysql Based On Previous Selection"