title: Form elements as arrays in Drupal
body: <p>Using Drupal 6.20.</p>
  
  <p>We can setup some form elements like this:-</p>
  
  <pre><code>&lt;input type="select" name="somename[]"&gt;&lt;option&gt;ohai&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>and then cycle through them in PHP with</p>
  
  <pre><code>foreach ($somename as $name) { ... }
  </code></pre>
  
  <p>I am trying to do the same in Drupal. I have a list of <code>select-elements</code> that are identical in style. The number of elements may change in the future so the form processing has to be dynamic.</p>
  
  <p>If I use the above approach, each element will overwrite the preceding one, so that ultimately only one element is printed to the screen. I can't write <code>name="somename[$someid]"</code> as that will not interpret <code>$somename</code> as an array.<br /> Does Drupal support this or am I doing it worng?</p>
  
  <p>Also, Is there any other alternative to achieve the same?</p>