How can I add additional attributes to my select menu option tags? Like this:
<select class="test" name="data[Test][test]">
<option value="1" data-price="100">My Option</option>
</select>
How do I add the data-price="100" ?
I tried something like this but it didn’t work:
<?php
echo $this->Form->select('test', $options, null, array(
'class' => 'test',
'options' => array(
'data-price' => 100
)
));
?>
check this out:
http://www.dereuromark.de/2012/03/01/some-new-crazy-cakephp-tricks/
“Setting additional attributes for some select options”