title: Zend form and dynamic file upload
body: <p>Hello there i'm trying to create a form with Zend_Form that will enable my user to upload a unlited number of files to my site, witch is done by javascript.</p>
  
  <p>Something like</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function(){
      var image_uploade_i = 0;
      $('#upload_more').click(function() {
          image_uploade_i++;
          $('#upload_list').append('&lt;div id="image_uploade_id_'+image_uploade_i+'" style="display: none;"&gt;&lt;input type="file" name="image[]" /&gt;&lt;br /&gt;&lt;/a&gt;');
          $('#image_uploade_id_'+image_uploade_i).slideDown('slow');
      });
  });
  &lt;/script&gt;
  &lt;?=$this-&gt;translate('Add images')?&gt;
  &lt;form action="" method="post" enctype="multipart/form-data"&gt;
      &lt;div id="upload_list"&gt;
          &lt;input type="file" name="image[]" /&gt;&lt;br /&gt;
          &lt;input type="file" name="image[]" /&gt;&lt;br /&gt;
          &lt;input type="file" name="image[]" /&gt;&lt;br /&gt;
      &lt;/div&gt;
      &lt;a href="#" id="upload_more"&gt;&lt;?=$this-&gt;translate('Upload another image')?&gt;&lt;/a&gt;&lt;br /&gt;
      &lt;input type="submit" name="image_uploade" value="&lt;?=$this-&gt;translate('Upload images')?&gt;" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>But i'm am unable to find out how i can create something like this with Zend_From, the only reason i want to use Zend_Form on this thoug is for validation of the uploadet files.</p>
  
  <pre><code>    $element = new Zend_Form_Element_File('image');
      $element-&gt;setRequired(true)
              -&gt;setLabel('Profile image')
              -&gt;setDestination($store)
              -&gt;setValueDisabled(true)
              -&gt;addValidator(new Zend_Validate_File_ImageSize(array(
                                          'minheight' =&gt; 100, 'minwidth' =&gt; 150,
                                          'maxheight' =&gt; 1920, 'maxwidth' =&gt; 1200)))
              // File must be below 1.5 Mb
              -&gt;addValidator(new Zend_Validate_File_FilesSize(array('max' =&gt; 1572864)))
              -&gt;addValidator(new Zend_Validate_File_IsImage());
  </code></pre>
  
  <p>If any 1 can help me set this up would i be verry great full :D</p>