dropdowns with optgroup

Talk about new features for CMSMS and modules.
Post Reply
gardnern

dropdowns with optgroup

Post by gardnern »

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

Code: Select all

array(
 [0] => Item One
 [1] => Item Two
)
It could check if its a multideminisonal array, and if so create opt groups...

Code: Select all

array(
 ['Group One'] => array(
   [0] => Item One
   [1] => Item Two
 )
 ['Group Two'] => array(
   [2] => Item Three
   [3] => Item Four
 )
)
which would generate...

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>
Post Reply

Return to “Feature ideas”