[Solar-talk] form select options

Jeff Surgeson solar at 3hex.com
Tue Nov 6 13:33:41 CST 2007


> > $form->setElements(array(
> >    'gallery[main_cat]'  => array(
> >        'type'          => 'select',
> >        'options'       => array('family', 'children', 'babies'),
>
> It looks like the options array is keyed numerically.  For select
> options, the array key is used as the database value and the array
> value is the displayed label.  Thus, to save the words instead of the
> numbers, you would need:
>
>      'options' => array(
>          'family' => $this->locale('OPTION_FAMILY'),
>          'children' => $this->locale('OPTION_CHILDREN'),
>          'babies' => $this->locale('OPTION_BABIES'),
>      ),
>
> Hope that helps, let me know if it does not.

Sure Does Thanks :-)

-- 
...........::::::...........
Jeff Surgeson / South Africa


More information about the Solar-talk mailing list