views:

525

answers:

1

Hi. I am creating a Zend Form to allow the user to change the current Locale from a list saved in my DB. I would like to know how to add more attribs to the option list.

$obj_locales_select = new Zend_Form_Element_Select('sel_locale');
$obj_locales_select->setLabel('form-params-language-changelocale-sel_locale-label');
$obj_locales_select->setMultiOptions($this->_arr_locales);
$obj_locales_select->setValue($this->_str_selected_locale);
$obj_locales_select->setRequired(true);
$obj_locales_select->setAttrib('tabindex', '100');

The $this->_arr_locales is just an associative array with key - values. But I want, in example, to add a title attrib to each option generated, so when the user's mouse is over an option, the browser displays a tip with additional info about that option, or some other standard attribs (according to the w3schools OPTION tag).

Thanks for help.

A: 

ZF does not support title attribute for Zend_Form_Element_Select options. You should write custom view helper to do that.

Yaroslav
Ok, I'll create my own view helper. Thanks!
David Zapata