Scooby08 Posted December 17, 2008 Share Posted December 17, 2008 Would it be possible to break these dynamically generated options into optgroups?? Say "Group1" and "Group2".. <script> function setOptions(chosen) { var selbox = document.mainform.new_image; selbox.options.length = 0; if (chosen == "/") { selbox.options[selbox.options.length] = new Option('<?=$imgname?>','<?=$image?>'); } if (chosen == "/test/") { selbox.options[selbox.options.length] = new Option('<?=$imgname?>','<?=$image?>'); } } </script> Link to comment https://forums.phpfreaks.com/topic/137448-add-an-optgroup-to-dynamically-generated-dropdowns/ Share on other sites More sharing options...
Psycho Posted December 17, 2008 Share Posted December 17, 2008 This page has an example: http://groups.google.co.ke/group/comp.lang.javascript/msg/011abc4a091f62c5 Link to comment https://forums.phpfreaks.com/topic/137448-add-an-optgroup-to-dynamically-generated-dropdowns/#findComment-718336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.