jquery ajax post and response evaluation
<p>i am relatively new to javascript and jquery in particular, so please bear with me, i am trying to loop through multiple s and then serialize() the data with jquery and post it using ajax to my page, this's happening alright, and the data is posted, and my php script echos 1 and everything is taken care off, but for some strange reason, the following code is not working, specially the "success" variable, it's not increasing at all! would you please help me?</p>

<pre><code>    $('.submitB').click(function(){

            var success = 0;
            var times = 0;
            var alertText;


        $('.input').each(function(){

            times++;

            var serializedForms = $(this).serialize();

            $.post('&lt;?=$this-&gt;config-&gt;site_url()?&gt;crud/additem/forms', serializedForms ,function(data){
                if (data)
                {
                    success++;
                }
                });
        });

            if (times)
                {
                    alertText = "تم إدخال " + success + " مدخل من إصل " + times + " بنجاح.";
                    alert(alertText);
                }

    })
</code></pre>

<p>the Arabic text just says "success + Entries from + times + were entered successfully"..</p>

<p>thank you in advance.</p>
