title: c# html array of form elements
body: <pre><code>@using (Html.BeginForm()) {
      @Html.ValidationSummary(true)
      &lt;div id="elem"&gt;
          &lt;div class="fields"&gt;
              &lt;select name="items[1][0]" id="items[1][0]"&gt;
              &lt;option value="1"&gt;Book&lt;/option&gt;
              &lt;option value="2"&gt;Brush&lt;/option&gt;
              &lt;/select&gt;&amp;nbsp;&amp;nbsp;
              &lt;input type="text" value="1" name="items[1][1]" id="items[1][1]"&gt;&amp;nbsp;&amp;nbsp;
              &lt;a id="test" href="#"&gt;Remove Item&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;       
      &lt;/div&gt;&lt;a href="#" id="addElem"&gt;Add Item&lt;/a&gt;&lt;/div&gt;
      &lt;br /&gt;
      &lt;input type="submit" name="name" value="Submit" /&gt;
  }
  </code></pre>
  
  <p>Basically, it has a set of two fields a name field and a serial field but defined in a two dimensional array. The <code>Add Item</code> link works in a way that when a user clicks on, it adds a new set of fields with the id being the current time <code>var new_id = new Date().getTime();</code> using JavaScript. So for example, the new set of fields would be:</p>
  
  <pre><code>&lt;div class="fields"&gt;
  &lt;select name="items[1368034980308][0]" id="items[1368034980308][0]"&gt;
  &lt;option value="1"&gt;Book&lt;/option&gt;
  &lt;option value="2"&gt;Brush&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="text" name="items[1368034980308][1]" id="softwarePerAsset[1368034980308][1]"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I would like to submit them to an edit action where the edit action will go through the <code>items</code> array and add the two fields.</p>
  
  <p>My Edit action looks like this:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Edit(FormCollection col, string[,] items)
  {
      return View();
  }
  </code></pre>
  
  <p>I have set a break point on the this action but the <code>items</code> array is empty and I can only access the fields through the <code>FormCollection col</code> variable.</p>
  
  <p>Is there something I am missing for the <code>items</code> array not to be set properly.</p>