Sure, it's (afaik) undocumented, but it can be done:

<?
echo $form->create('Bacon');

$colours = array(
        array('name' => 'Red',   'value' => '#F00', 'style' => 'background-
color: #F00'),
        array('name' => 'Green', 'value' => '#0F0', 'style' => 'background-
color: #0F0'),
        array('name' => 'Blue',  'value' => '#00F', 'style' => 'background-
color: #00F')
);

echo $form->input('colour', array('options' => $colours));

echo $form->end('Eggs');
?>

That should do the trick!

hth
grigri

On Aug 12, 1:45 pm, DavidH <[email protected]> wrote:
> Hi
>
> Is there any way of passing style settings for each select option when
> using $form->select?
>
> I've a drop down that allows users to choose a colour from a long
> list. It would be cool(ish) if the each option in the select had the
> background-color set to the actual colour.
>
> Thanks
>
> David
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to