ZF-4282: Zend_Form contains more than Zend_Form_Element_File elements with validation always fails

Description

The below form never finished it seems to the validation some how swapped! If the form contains single file element its working as expected. I tried to track it down without result.


class ProductForm extends Zend_Dojo_Form{

    public function __construct(){
        parent::__construct();
                $image = new Zend_Form_Element_File('image');
        $image->setLabel('Image:');
        $image->addValidator(new Zend_Validate_File_Extension(array('gif', 'jpg', 'png')));
        $image->setIgnore(true);

        $brochure = new Zend_Form_Element_File('brochure');
        $brochure->setLabel('Brochure:');
        $brochure->addValidator(new Zend_Validate_File_Extension(array('pdf', 'doc')));
        $brochure->setIgnore(true);

               $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Submit');
        $submit->setRequired(false);
        $submit->setIgnore(true);

                $this->addElement($image);
        $this->addElement($brochure);
        $this->addElement($submit);
        $this->setMethod("post");
        $this->setAttrib('enctype', 'multipart/form-data');
    }

}

Comments

2 different file elements are for now not supported if you use different validators. This is a feature request we already know.

Multiple files should work with trunk release. Please test and report back.

Note: Subforms are not supported until now! This is a separat issue Note: Dojo is a complete different thing. When you're having problems with Dojo please assign a dojo issue and not a form issue.

If I get no response until 22.Sept. I will close this issue as solved.