Is it possible to set a class on Zend MultiOptions?

Robert8486

New Member
I have a Zend_Form_Element_MultiSelect element. I would like the output to be something like this:\[code\]<select id="users" multiple="multiple" name="users[]"> <option value="http://stackoverflow.com/questions/3559986/1" class="role-1">User 1</option> <option value="http://stackoverflow.com/questions/3559986/2" class="role-1">User 2</option> <option value="http://stackoverflow.com/questions/3559986/3" class="role-2">User 3</option></select>\[/code\]Is there a way to set class attributes on specific options? I haven't been able to come across anything that would let me do this yet.Edit: looking at Zend/View/Helper/FormSelect::_build, it doesn't look like there is an automatic way to assign the class. I suppose the only way would be to build the options myself in the view template.
 
Back
Top