Possible duplicate:Zend Framework - set the "selected" value in the drop-down list box
I have a Zend_Form with a Zend_Form_Select element. I populate it from an array (the code inside Application_Form_MyForm extends the Zend_Form class):
$options = array('first option', 'second option', 'third option'); $this->getElement('mySelect')->addMultiOptions($options);
How can I choose which value will be selected automatically, as in "<option value="second option" selected="selected">second option</option>" ? Thank you!
"<option value="second option" selected="selected">second option</option>" ?
To fill in all form values, you can call $ form-> populate ($ dataAsArray);
, $select- > setValue ('valueHere'); , , sigle, .
: Zend_Form_Element_Multi
Nevermind... ($ form- > populate) . , , , , , - .
Source: https://habr.com/ru/post/1759791/More articles:Python module issues - pythonProbabilistic clustering methods for similar text data? - text-processingsetTimeout not being called in android webkit - javascriptWCF Data Border Design - .netSolr How to delete all EXCEPT entries in an array? - htmlZend_Form_Element_Multi element definitionSelect an element - zend-frameworkAndroid Tabs & Intents - androidHow can I replace the iPod with my application icon when my application plays audio in the background? - iphoneэкономия поисковых терминов rails thinkingsphinx - ruby-on-railsShould I learn SQL Server 2008 or Oracle 11g - databaseAll Articles