Populating A Dropdown List
I have a dropdown list that I am trying to populate the values of.
<select name="brokers">
<cfoutput group="id" query="getDBAGroups">
<option class="groupName" value="<cfoutput>#brokers_id#</cfoutput>">#name#</option>
<cfoutput>
<option class="broker" value="#brokers_id#" <cfif session.statFilter.brokers EQ brokers_id>selected</cfif>> #fixStringCase(dba)#</option>
</cfoutput>
</cfoutput>
</select>
The first option is a group name and each of its members are listed under it (I cannot use optgroup because I need the group to be selectable). The value of this option needs to be a comma seperated list of each of its members. I can get the list to output, but is there a function that will add the commas? I can add the comma to the end of the string and then strip the last one, but here is my second problem. I need the value to show selected if it matches another value.
ie. <cfif session.userBrokerView EQ #valueList#>selected</cfif>
Any thoughts?