开发者

Zend Form problem:Setting decorators for textarea and textinput length values

开发者 https://www.devze.com 2022-12-23 19:09 出处:网络
In my Zend form code I have the following $address = new Zend_Form_Element_Textarea(\'accounts_address\');

In my Zend form code I have the following

$address = new Zend_Form_Element_Textarea('accounts_address');
        $address->setLabel('Address')
                    ->setAttrib('rows','4')
                    ->setAttrib('cols','4')                 
                    ->addFilter('StripTags')
                    ->addFilter('StringTrim')
                    ->addValidator('NotEmpty');
        $address-&开发者_高级运维gt;setDecorators(array(  
                   'ViewHelper',
                   'Description',
                   'Errors',
                   array(array('data'=>'HtmlTag'), array('tag' => 'td')),
                   array('Label', array('tag' => 'td')),
                   array(array('row'=>'HtmlTag'),array('tag'=>'tr'))
                ));

However in my output I do get the attributes set but the text area seems to remain the same size

Output

<tr><td id="accounts_address-label"><label for="accounts_address" class="optional">Address</label></td>
<td>
<textarea name="accounts_address" id="accounts_address" rows="4" cols="4"></textarea></td></tr>

What am I missing?

0

精彩评论

暂无评论...
验证码 换一张
取 消