dropdowns with optgroup
Posted: Fri Aug 03, 2007 3:16 pm
Would be great if the dropdown functions (CreateInputDropdown, ect) had the option of using .
I would suggest doing this by the way you pass an array to the function. Right now, it takes a single dimension array
It could check if its a multideminisonal array, and if so create opt groups...
which would generate...
I would suggest doing this by the way you pass an array to the function. Right now, it takes a single dimension array
Code: Select all
array(
[0] => Item One
[1] => Item Two
)
Code: Select all
array(
['Group One'] => array(
[0] => Item One
[1] => Item Two
)
['Group Two'] => array(
[2] => Item Three
[3] => Item Four
)
)
Code: Select all
<select>
<optgroup label="Group One">
<option value="0">Item One</option>
<option value="1">Item Two</option>
</optgroup>
<optgroup label="Group Two">
<option value="2">Item Three</option>
<option value="3">Item Four</option>
</optgroup>
</select>