Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by warra ( 13 years ago )
$(document).ready(function()
{
    $('.section').change(function()
    {
        var id = $('.section').val();
        
        $.ajax
        ({
            type: 'POST',
            url: 'http://www.example.com/combobox_category/' + id,
            data: id,
            cache: false,
            success: function(html)
            {
                $('.category').html(html);
                var id2 = $('.category').val();
        
                $.ajax
                ({
                    type: 'POST',
                    url: 'http://www.example.com/combobox_subcategory/' + id + '/' + id2,
                    data: (id, id2),
                    cache: false,
                    success: function(html2)
                    {
                        $('.subcategory').html(html2);
                    }
                });
            }
        });
    });
});

 

Revise this Paste

Your Name: Code Language: