-- Joó Ádám <[email protected]> wrote
(on Friday, 20 February 2009, 07:08 PM +0100):
> How can I set the selected values in a multiselect element? I tried to
> call setValue() multiple times and also passing an array to it, but
> none of them worked.
Passing an array of values to setValue() should work. The values in the
array should correspond to the keys passed when setting the
multiOptions:
$multi->setMultiOptions(array(
'foo' => 'Foo',
'bar' => 'Bar',
'baz' => 'Baz',
'bat' => 'Bat',
));
$multi->setValue(array('foo', 'bat'));
--
Matthew Weier O'Phinney
Software Architect | [email protected]
Zend Framework | http://framework.zend.com/