title: How to add a user input field to a URL
body: <p>I have a PHP generated list of product links that, when clicked, adds a product to a shopping cart.  At present, there's a quantity of '1' hard-coded in the links, e.g.</p>
  <p><code>&lt;a href=&quot;/shop/checkout?1[sku]=$sku&amp;1[qty]=1&quot;&gt; Add To Cart &lt;/a&gt;</code></p>
  <p>I'd like to add a quantity field to each item in the list, so a customer can add the quantity they want to the cart.</p>
  <p>This list doesn't use a form, so how could I introduce a user input qty field and use it in each link?  My searches have turned up nothing, so I take it that it can't be done the way I have it set up now.  No matter how I change this list, I need to pass an array to the /shop/checkout PHP script.</p>
  <p>I'm probably looking at this the wrong way, so any pointers would be appreciated.</p>
  <p>Thanks!</p>
  <p><strong>EDIT</strong></p>
  <p>It must have something to do with the fact that my product list is in a table.  When I change your example to use a table instead of divs, it breaks.  Here's a sample:</p>
  <pre><code>&lt;table class=&quot;products_list&quot;&gt;
  &lt;tr class=&quot;product_list--item&quot;&gt;
      &lt;td&gt; 12486XC4 &lt;/td&gt;
      &lt;td&gt; Amount: &lt;span class=&quot;item_display--1[qty]&quot;&gt;1&lt;/span&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;input class=&quot;item_qty&quot; id=&quot;itm_qty&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;100&quot; value=&quot;1&quot; size=&quot;5&quot; /&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;a href=&quot;https://www.example.com/checkout/?1[sku]=12486XC4&amp;1[qty]=1&quot;&gt;Add to cart&lt;/a&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class=&quot;product_list--item&quot;&gt;
      &lt;td&gt; 13486XC5 &lt;/td&gt;
      &lt;td&gt; Amount: &lt;span class=&quot;item_display--1[qty]&quot;&gt;1&lt;/span&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;input class=&quot;item_qty&quot; id=&quot;itm_qty&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;100&quot; value=&quot;1&quot; size=&quot;5&quot; /&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;a href=&quot;https://www.example.com/checkout/?1[sku]=13486XC5&amp;1[qty]=1&quot;&gt;Add to cart&lt;/a&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr class=&quot;product_list--item&quot;&gt;
      &lt;td&gt; 14486XC6 &lt;/td&gt;
      &lt;td&gt; Amount: &lt;span class=&quot;item_display--1[qty]&quot;&gt;1&lt;/span&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;input class=&quot;item_qty&quot; id=&quot;itm_qty&quot; type=&quot;number&quot; min=&quot;1&quot; max=&quot;100&quot; value=&quot;1&quot; size=&quot;5&quot; /&gt; &amp;nbsp; &lt;/td&gt;
      &lt;td&gt; &lt;a href=&quot;https://www.example.com/checkout/?1[sku]=14486XC6&amp;1[qty]=1&quot;&gt;Add to cart&lt;/a&gt; &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  <p>Also, <code>1[sku]</code> and <code>1[qty]</code> are invariable in the links.  They are used in the destination PHP script for each product on this page.  The <em>only</em> thing that changes from product to product is the value of the sku.</p>