title: Submit data from two forms by one independent button and insert data to DB
body: <p>I'm working on project that is build on Wordpress (I'm using WP because of friendly permissions and rights system) and basically it's written by myself in PHP with a few javascript elements on my own single-pages. Now I need your help. I generate two forms by my PHP script. The template of each form is in MySQL DB table. It's because of friendly editing and administration for each particular row in each form for my not-very-skilled-with-pc collegues that need edit forms without my help. So I have some administration page for forms, collegue makes some changes, save it and script will generate edited form. It works perfectly. Script generate something like below (don't look at messy code, it's only beta without css etc.)</p>
  
  <pre><code>&lt;form id="f1" method="POST" class="form-product-item" style="display: block;"&gt;
  &lt;fieldset form="f1" name="f1_f"&gt;
      &lt;legend&gt; &amp;nbsp; FORM 1 &amp;nbsp; &lt;/legend&gt;
      &lt;table style="width: 320px; max-width: 320px; float: left; margin: 5px"&gt;
          &lt;tr class="optional f1r1" name="f1r1_v" style="display: block;" &gt;
              &lt;td style="width: 120px; min-width: 120px; max-width: 120px; height: 48px; max-height: 48px;"&gt;
                  &lt;div class="optional f1r1" name="f1r1_v" style="display: block;" class="hidden-txt"&gt;Row 1 Form 1: &lt;/div&gt;
              &lt;/td&gt;
              &lt;td style="width: 140px; min-width: 140px; max-width: 140px"&gt;
                  &lt;input type="text" class="optional f1r1" name="f1r1_v" style="display: block;" class="hidden-txt" placeholder="Row 1 Form 1" size="15" /&gt;
              &lt;/td&gt;
              &lt;td style="width: 60px; max-width: 60px; max-width: 60px"&gt;suffix&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  
      &lt;div style="clear: both"&gt;&lt;/div&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;form id="f2" method="POST" class="form-product-item" style="display: block;"&gt;
  &lt;fieldset form="f2" name="f2_f"&gt;
  &lt;legend&gt; &amp;nbsp; FORM 2 &amp;nbsp; &lt;/legend&gt;
  &lt;table style="width: 320px; max-width: 320px; float: left; margin: 5px"&gt;
      &lt;tr class="optional f2r1" name="f2r1_v" style="display: block;" &gt;
          &lt;td style="width: 120px; min-width: 120px; max-width: 120px; height: 48px; max-height: 48px;"&gt;
              &lt;div class="optional f2r1" name="f2r1_v" style="display: block;" class="hidden-txt"&gt;Row 1 Form 2: &lt;/div&gt;
          &lt;/td&gt;
          &lt;td style="width: 140px; min-width: 140px; max-width: 140px"&gt;
              &lt;select id="f2r1_dm" name="f2r1_v" style="width: 120px"&gt;
                  &lt;option selected&gt;- Choose -&lt;/option&gt;
                  &lt;option&gt;Option 1&lt;/option&gt;
                  &lt;option&gt;Option 2&lt;/option&gt;
              &lt;/select&gt;
          &lt;/td&gt;
          &lt;td style="width: 60px; max-width: 60px; max-width: 60px"&gt;suffix&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="optional f2r2" name="f2r2_v" style="display: block;" &gt;
          &lt;td style="width: 120px; min-width: 120px; max-width: 120px; height: 48px; max-height: 48px;"&gt;
              &lt;div class="optional f2r2" name="f2r2_v" style="display: block;" class="hidden-txt"&gt;Row 2 Form 2: &lt;/div&gt;
          &lt;/td&gt;
          &lt;td style="width: 140px; min-width: 140px; max-width: 140px"&gt;
          &lt;input type="text" class="optional f2r2" name="f2r2_v" style="display: block;" class="hidden-txt" placeholder="Row 2 Form 2" size="15" /&gt;
          &lt;/td&gt;
          &lt;td style="width: 60px; max-width: 60px; max-width: 60px"&gt;suffix&lt;/td&gt;
      &lt;/tr&gt;
  
      &lt;div style="clear: both"&gt;&lt;/div&gt;
  &lt;/table&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now I want to ask you friends, how to make one independent submit button below "FORM 2" (outside from form tags) that submit values from all fields from both forms at once and insert it to DB. I tried some advises I found here on stackoverflow but they did not work for me.
  I'm quite begginer with PHP and Java, AJAX I know very cursorily. So, for some advice or step by step tutorial I'll be very appreciate.
  Thank you very much for any help ;).</p>