Why zend_form cannot populate inputs with records

2019-09-01 02:54发布

I have zend application connected to Firebird database via ZendX library. It has windows-1250 charset. I am trying to use zend_form to create edit form and populate it with db values. It works with records free of diacritic characters and data is displayed properly, it's editable. Problem occurs whenever there are special characters, and form inputs are empty.

 $form->addElement(
                          'textarea',
                          'POD',
                          array(
                            'value' => $this->ksiega['POD'],
                            'attribs' => array( 'class' => 'pod'),
                          )
                        );
                $form->setElementDecorators(array(
                'ViewHelper',
                'Errors'
              ));

This shows empty input fields.

<textarea name="POD" id="POD" class="pod" rows="24" cols="80"><?=$this->ksiega['POD']?></textarea>

This code works. What am I not aware of here?

1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-09-01 03:43

Think problem is that an textarea has no value attribute (?).

You could try:

$elem = $form->getElement('POD');
$elem->setValue($this->ksiega['POD']);
查看更多
登录 后发表回答