Jump to content

Add an optgroup to dynamically generated dropdowns.


Scooby08

Recommended Posts

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.