Why zend_form cannot populate inputs with records from Firebird db with diacritic characters?

ぐ巨炮叔叔 提交于 2020-01-06 05:49:10

问题


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:


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

You could try:

$elem = $form->getElement('POD');
$elem->setValue($this->ksiega['POD']);


来源:https://stackoverflow.com/questions/5806190/why-zend-form-cannot-populate-inputs-with-records-from-firebird-db-with-diacriti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!