title: Variable number of input fields in form
body: <p>I have a HTML table base invoice for collecting the details of a order. New table rows can be added or deleted to this as the user needs them. Table has columns like item name, type, color, unit price, qty. I have place <code>&lt;input&gt;</code> and <code>&lt;select&gt;</code> tags inside <code>&lt;td&gt;</code> tags to collect data.</p>
  
  <p>I need to submit a complete invoice to a database. The problem I'm having is I'm not sure how to get input values to my <code>$_POST</code> variables since the number of <code>&lt;input&gt;</code> and <code>&lt;select&gt;</code> vary from time to time based on the items on the invoice.</p>
  
  <p>I can give dynamic or static names to input fields based on the table row id when they are generated using javascript. But how can I collect these data in the submit end to my php arrays or variables?</p>
  
  <p>This is one table row. All other are similar to this.</p>
  
  <pre><code>&lt;tr class="table_row_blue"&gt;
                  &lt;td class="table_data_index"&gt;1&lt;/td&gt;
                  &lt;td&gt;&lt;select&gt;
                      &lt;option&gt;Test&lt;/option&gt;
                      &lt;/select&gt;&lt;/td&gt;
                  &lt;td class="table_data_item"&gt;&lt;select&gt;   
                      &lt;option&gt;&amp;nbsp;2GB&amp;nbsp;&lt;/option&gt;
                  &lt;/select&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" id="price_field" size="6"&gt;&lt;/td&gt; 
                  &lt;td&gt;&lt;input type="text" id="qty_field" size="6"&gt;&lt;/td&gt; 
                  &lt;td&gt;&lt;span class="table_subtotal"&gt;125,200.00&lt;/span&gt;&lt;/td&gt;
  
              &lt;/tr&gt;
  </code></pre>
  
  <p>Please give me some ideas to implement my idea.</p>