Found the answer in case anyone has the same question. I had to look
at the __selectOptions() code in /cake/libs/views/helpers/form.php to
figure it out.
Instead of using the key=>value options like this:
$attributes['options'] = array('1'=>'Option 1');
you would use value, name and class key=>value options like this:
$attributes['options'] = array('value'=>'1', 'name'=>'Option 1',
'class'=>'option1class');
On Oct 16, 2:08 pm, tnizzle <[EMAIL PROTECTED]> wrote:
> I need to add specific attributes to select box options and I havent
> found any info on this. Is there a way to add a class to individual
> options?
>
> Instead of:
> <select name="selectbox">
> <option value="1">Option 1</option>
> </select>
>
> I need to add a class to the option like so:
> <select name="selectbox">
> <option value="1" class="option1class">Option 1</option>
> </select>
>
> Any help or ideas would be greatly appreciated...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---