title: Zend Framework: Working with Form elements in array notation
body: <p>I would like to be able to add a hidden form field using array notation to my form. I can do this with HTML like this:</p>
  
  <pre><code>&lt;input type="hidden" name="contacts[]" value="123" /&gt;
  &lt;input type="hidden" name="contacts[]" value="456" /&gt;
  </code></pre>
  
  <p>When the form gets submitted, the <code>$_POST</code> array will contain the hidden element values grouped as an array:</p>
  
  <pre><code>array(
      'contacts' =&gt; array(
          0 =&gt; '123'
          1 =&gt; '456'
      )
  )
  </code></pre>
  
  <p>I can add a hidden element to my form, and specify array notation like this:</p>
  
  <pre><code>$form-&gt;addElement('hidden', 'contacts', array('isArray' =&gt; true));
  </code></pre>
  
  <p>Now if I populate that element with an array, I expect that it should store the values as an array, and render the elements as the HTML shown above:</p>
  
  <pre><code>$form-&gt;populate($_POST);
  </code></pre>
  
  <p>However, this does not work. There may be a bug in the version of Zend Framework that I am using. Am I doing this right? What should I do differently? How can I achieve the outcome above? I am willing to create a custom form element if I have to. Just let me know what I need to do.</p>