Chris Tankersley wrote:
> I have a select element inside of a form object where I call
> ->setValue() on the form's initialization to select a default value.
> When I do a $form->populate($data) in my controller the value for this
> select element is not being set correctly and always defaults to the
> default value from initialization. My other select elements in the
> form work fine except for this one.
>
> ====FORM====
> $protClass = new Zend_Form_Element_Select('protClass');
> $protClass->setLable('Protection Class:')
> ->setRequired(true)
> ->setValue(9)
> ->setMultiOptions($protClassRange);
>
> ====CONTROLLER====
> $form->populate($rate->toArray()); // this has protClass at the correct value
Dear Chris, in my case there's no need to setValue when populate ..
it's done auto.
--
Bruno Friedmann