0

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.

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you - I knew it was something simple - it just proves how big of a "newb" I am as far as JQ is concerned, but I'm learning ... thank you again ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.