htmlOptions explained for various controls.

Comparing #1 with #2

Revision #2 was created by Woil Woil on Feb 11, 2011, 10:22:52 PM.

remove $ from $htmlOptions so that it comes up in search

Content

[...]
<option>
<option>
</select>
~~~

To get attributes onto the options, add a sub-array called "options" to your
$htmlOptions. For example to color each item in your drop down a different color this code:


```php
$items = array("1" => "first", "2" => "second");
$options["options"] = array("1"=>array("style" => "color:red"), "2"=>array("style"=>"color:blue"));
[...]