I tried trial and error with jquery, but it doesn't work
<p>I have a form with many selects created with php. The form has 3 type of selects: the second select is conditioned on the choice of the first and the third is conditioned on the choice of the second. Every select has an id like this: type[00], type [01], type[02]; make[00], make[01], make[02]; model[00], model[01], model[02] ...</p>

<p>I use <a href="http://forum.codecall.net/topic/59341-php-sql-jquery-and-ajax-populate-select-boxes/#sthash.i2ISGn69.dpbs" rel="nofollow">this script</a>. I tried to edit the code to suit my needs, but I know nothing of java or jquery. I think that the problem is the function finishAjax becuase I don't know how to say it that the id is different for any select.</p>

<pre><code>$(document).ready(function() {

        $('select[id^="type"]').change(function(){

            $('select[id^="make"').fadeOut();

            $.post("ajax/ajax_make.php", {
                type: $('select[id^="type"]').val()
            }, function(response){
                setTimeout("finishAjax('make', '"+escape(response)+"')", 400);
            });
            return false;
        });

        $('select[id^="make"').change(function(){

            $('select[id^="model"').fadeOut();

            $.post("ajax/ajax_model.php", {
                type: $('select[id^="type"]').val(),
                make: $('select[id^="make"').val()
            }, function(response){
                setTimeout("finishAjax('model', '"+escape(response)+"')", 400);
            });
            return false;
        });

        });

        function finishAjax(id, response){

         $('select[id^="'+id+'"]').html(unescape(response));
         $('select[id^="'+id+'"]').fadeIn();
        }
</code></pre>
