PHP / JavaScript form submit
<p>I've got a form that I'm population with a variable, and then I want it to auto submit. I thought I had it nailed with this code</p>

<pre><code>&lt;script type="text/javascript"&gt;
      gup = function( name ){
      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)";
      var regex = new RegExp( regexS );
      var results = regex.exec( window.location.href );
      if( results == null )
        return "";
      else
        return results[1];
    }
    $(document).ready(function () {
    $('#inf_field_Email').val(gup('email'));
    // log
    $.ajaxSetup({ async: false });
    $.post("csv_log.php", { email: $('#inf_field_Email').val()},function (data) 
    { 
        if(data =='1'&amp;&amp;$('#inf_field_Email').val()!='')
        {
            $('#formInfusion').submit();
        }
        else{           
            $('#error').html('Loading...');
        }
    }, "text");
});
&lt;/script&gt;
</code></pre>

<p>But somewhere in the If/Else is causing it to stall. The form populates like I want it to and right now, I've overcome the obstacle by adding in </p>

<pre><code>&lt;script type="text/javascript"&gt;
$(function(){
$('#formInfusion').submit();
});
&lt;/script&gt;` 
</code></pre>

<p>After the the original code. Any help would be really appreciated. </p>
