Zend form multiselect repopulate after validation error

19boyd91

New Member
I have a Zend form multiselect element which I am creating like this \[code\]$this->addElement('multiselect','somedates',array( 'filters'=>array('StringTrim'), 'required'=>true, 'label'=>'Dates', 'style' => 'width:14em', 'size'=>'4', 'RegisterInArrayValidator' => false, //otherwise it gives an error ));\[/code\]then I add some multi options into the multi-select dynamically through JavaScript into the multi-select (basically a YUI calendar where a user clicks on a date and that gets into multi-select as an option)Everything works fine if I give all the required values to the form and it passes the isValid test however, if there is an error, every other element gets repopulated with whatever was submitted but multi-select looses all it's options and has to be re-populated by the user itself. Multi-select appears to be going fine as this is what i get if I var dump \[code\]$this->getRequest()->getQuery();\[/code\]this is what I get \[code\]["somedates"]=> array(2) { [0]=> string(10) "2010-09-09" [1]=> string(10) "2010-09-10" }\[/code\]I am just wondering if anybody else had the same experience and know what is going wrong over here or if the Zend Framework is capabale of repopulating the multi-selects.
 
Back
Top