views:

2378

answers:

2

I tried:

                $form->addElement(
                    'select',
                    'salutation',
                    array(
                        'required' => true,
                        'options' => array(
                            'Mr.' => 'Mr.',
                            'Mrs.' => 'Mrs.',
                            'Ms.' => 'Ms.',
                        ), 
                    )
                );

Then I print_r-ed the form, and options for salutation are empty. Does anybody know the correct spell for that? As far as I see, there's no documentation for Zend element configs' format.

A: 

This should get you on the right track http://framework.zend.com/manual/en/zend.form.elements.html#zend.form.elements.config

thr
Yep, I already have that open. Nothing specifically about "select". I guess, I'll just dig the source code.
Ivan Krechetov
+6  A: 

You should use 'multiOptions' instead of 'options'.

bertbalcaen
Yes, that's the trick. Thanks!
Ivan Krechetov