Issues

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

Issue Type: Bug Created: 2008-09-13T08:40:03.000+0000 Last Updated: 2008-10-10T14:41:46.000+0000 Status: Resolved Fix version(s): - 1.6.2 (13/Oct/08)

Reporter: Mina R Waheeb (syncer) Assignee: Thomas Weidner (thomas) Tags: - Zend_Form

Related issues: Attachments:

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.

<pre class="highlight">
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

Posted by Thomas Weidner (thomas) on 2008-09-14T04:28:33.000+0000

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

Posted by Thomas Weidner (thomas) on 2008-09-20T15:27:03.000+0000

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.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts