title: post multiple forms on a single button press
body: <p>My page conisits of x amount of forms. One for each database entry. The user can change the data and save the individual item back to the database.</p>
  
  <p>But where I am stuck is with a SAVE ALL button. Can you post multiple forms?? I am pretty certain you cannot with php, so I'm looking at javascript to solve my problems. Specifically:</p>
  
  <pre><code>document.forms.submit();
  </code></pre>
  
  <p>All that is going on is happening on the same page (i.e. when a form is submitted it puts a value at the end of the URL (<code>foo?delete=true</code>), and there is php at the top of the page which does something like: <code>if delete is true -&gt; delete field... else carry on as normal</code></p>
  
  <p>My brain is saying I should do something like: (where $size is a count of how many forms there are)</p>
  
  <pre><code>&lt;p onclick="saveAll('.$size.')"&gt;saveall&lt;/p&gt;
  </code></pre>
  
  <p>and the javascript function:</p>
  
  <pre><code>function saveAll(size) {
      for(i=0;i&lt;size;i++)
      {
           document.forms[i].submit();
           alert(i); // for testing purposes
      }
  }
  </code></pre>
  
  <p>The result of this was that the page started to refresh, then a popup with "0" came up, then the page refeshed and nothing else happend.</p>
  
  <p>Is what I need to do even possible? If so, hoooww?</p>
  
  <p>Thanks</p>