How to submit multiple jquery posts to a page one after another if database updates successfully?
<p>I am trying to send multiple $.post to a single page. I need each to post to a page that updates a database then post the next one until they are done. This is my code so far: </p>

<pre><code>$(document).ready(function(){
$("#action").change(function(){
var selectVal = $('#action :selected').val();
if(selectVal == "list-all"){

    $(".prelistCheckbox:checked").each(function(index) {
        var theValue = $(this).val();
        console.log('Values to be passed: ' + theValue);
        var form = $('form[id=' + theValue + ']');
        console.log(form.serialize());
//          $.post(form.attr('action'), form.serialize(), function(data) {
        $.post('jqueryPost.php', form.serialize(), function(data) {
            $('#results').text(data);
            console.log(data);
        });
    });

}
});
});
</code></pre>

<p>I'm really not sure how to make it make it do this. The forms are generated from rows of a database with a loop. </p>
