title: Send a form array to PHP using AJAX as a POST array
body: <p>Guys I am looking for a way to send my html form array to the php script to execute as an array.I tried several methods but nothing worked for me.Please suggest me a method to do it.My php array works well with normal submit but with ajax it says </p>
  
  <blockquote>
    <p>Warning: Invalid argument supplied for
    foreach() in
    C:\wamp\www\submit_order.php on line
    42</p>
  </blockquote>
  
  <p>My HTML form code-</p>
  
  <pre><code> &lt;input disabled="disabled" class="input_text" onkeyup="JAVASCRIPT:check_row();" name="qty[]" type="text" id="qty_field1" size="6"&gt;
  </code></pre>
  
  <p>My current ajax send params-  </p>
  
  <pre><code>var params="qty="+document.table_form.elements["qty[]"]";   
  </code></pre>
  
  <p>My PHP array fetch -</p>
  
  <pre><code>  foreach($_POST['qty'] as $value){
          if($index&lt;=$rows){
          $clean_value=mysql_real_escape_string($value);
          $clean_value=stripcslashes($clean_value);
          $product_data[$index][3]=$clean_value;
          $index=$index+1;
          }    
  </code></pre>
  
  <p>Thank you.</p>