ZF-6336: not able to reset Zend form

Issue Type: Bug Created: 2009-04-17T13:00:48.000+0000 Last Updated: 2009-04-19T05:40:43.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: huy tran ( Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:


I'm not sure if this has been reported or not but i'm not able to reset the field within Zend form using either javascript or Zend_Form_Element_Reset. Below is some simple script to generate the form. What you will notice is clicking on the reset button do not reset any of the fields within the form. What strange is that any fields that extends Zend_Dojo will get reset. If this is not a bug i hope someone could point out my mistake. Much appreciated.

    $form = new Zend_Form('test_form');

    $field2 = new Zend_Form_Element_Text('field2');
    $field2->setLabel('Field 2')
        ->addValidator('regex', false, array('/^[a-z]/'))

    $field3 = new Zend_Form_Element_Textarea('field3');
    $field3->setLabel('Field 3')

    $field4 = new Zend_Form_Element_Text('field4');
    $field4->setLabel('Field 4')
        ->addValidator('stringLength', false, array(20))

    $submit = new Zend_Form_Element_Submit('submit');
            array('HtmlTag', array('tag' => 'li', 'class' => 'submit-group')),

    $reset = new Zend_Form_Element_Reset('reset');
            array('HtmlTag', array('tag' => 'li', 'class' => 'submit-group')),

    $this->view->form = $form;


Posted by huy tran ( on 2009-04-17T13:06:34.000+0000

Ahhh i just narrow the problem. On the test form above i enabled Dojo as well included the dijit.form.Button module. This some how prevents the form from resetting. That said i now have a workaround.

thank you

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-19T05:40:38.000+0000

Closing, per comment from poster.

Have you found an issue?

See the Overview section for more details.


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

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