Reputation: 2105
I have drop-downs for:
1. manufacturer
2. products
3. colours
Manufacturer drop is fetched with page.
When I select manuf. from it Ajax appends #2.
When I select product, Ajax appends #3
Problem is, that #3 is is not being fetched.
I appreciate a hint.
Code I use:
$("#manuf").change(function(){ var manuf_id = $("#manuf").val(); $.ajax({ type: "POST", url: "ajax_product_preload.php", data: "manuf_id=" + manuf_id, success: function(data){ $("#prod_div").hide().html(data).fadeIn(); } }); });
Code for colour is similar, just a IDs, php file and data string change.
Php files are simple db queries and dropdowns, so posting them would be a waste of SO hdd .. I guess.
Upvotes: 0
Views: 46
Reputation: 32082
You are binding the change handler for #2's content before it loads, right? If that is the case, you can likely fix your problem using .live()
:
$("#prod").live('change', function(){
assuming that #prod
is the select
element that contains the list of products.
Upvotes: 3