$(document).ready(function() {
	$("#brand").change(function() {
		var brand_id = $(this).val();
		if(brand_id != "") {
			$.ajax({
				url:"get-category.php",
				data:{brand_id:brand_id},
				type:'POST',
				success:function(response) {
					var resp = $.trim(response);
					$("#category").html(resp);
				}
			});
		} else {
			$("#category").html("<option value=''>------- Select --------</option>");
		}
	});
	
	$('#category').change(function() {
        var category_id = $(this).val();
        if(category_id != "") {
            $.ajax({
                url:"get-product.php",
				data:{category_id:category_id},
				type:'POST',
				success:function(response) {
					var resp = $.trim(response);
					$("#product").html(resp);
				}
            }); 
        }else{
            $("#product").html("<option value=''>------- Select --------</option>");
        }
    });
});