Two bugs i think, both occur when you dojo enable a form. version 1.6.1

e.g.

1.

This :

$form = new Zend_Form();
Zend_Dojo::enableForm($form);
$form->addElement('text', 'foo', array('label' => 'bar'));
echo $form;

will output :

<form enctype="application/x-www-form-urlencoded" action="" method="post"
name=""><dl class="zend_form">
<dt><label for="foo" class="optional">bar</label></dt>
<dd>

<input type="text" name="foo" id="foo" value=""></dd></dl></form> 

Notice the empty name attribute, name="".


2.

All textarea elements break when a form with custom decorators is dojo
enabled. Am i doing something wrong here?

e.g. The following will break with the error "Catchable fatal error:
Argument 4 passed to Zend_Dojo_View_Helper_Textarea::textarea() must be an
array, null given in
path\to\Zend\1.6.1\library\Zend\Dojo\View\Helper\Textarea.php on line 64"

        $form = new Zend_Form();
        Zend_Dojo::enableForm($form);
        
        $form->setDecorators(array(
            'Description',
            'Errors',
            'FormElements',
            'Form'
        ));
        
        $form->addElement('textarea', 'foo', array(
            'decorators' => array(
                'Description',
                'Errors',
                'ViewHelper',
                array('Label'),
                array('HtmlTag', array('tag'=>'li'))
            ),
            'label' => 'bar'
            )
        );
        
        $form->addDisplayGroup(
            array('foo'), 'foobar',
            array(
                'decorators' => array(
                    'FormElements',
                    array('HtmlTag', array('tag'=>'ul')),
                    'Fieldset'
                ),
                'legend' => 'FooBar'
            )
        );
        echo $form;



-- 
View this message in context: 
http://www.nabble.com/Zend_Form---Zend_Dojo%3A%3AenableForm%28%29-bugs--tp19878670p19878670.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to