I am creating an edit page for coaches. I have a multiple select that generates and works fine. I am trying to make options in the menu "selected" according to a separate query (currentpos). The problem comes when the currentpos query generates more than one match (meaning two or more options should be selected). I tried to put a cfloop inside the option tag but that does not work.
Code:
<cfquery datasource="paper" name="pos">
select posname,posid from spcoachpos
</cfquery>
<cfquery datasource="paper" name="currentPos">
select posid, userid from spCoachAssign
where userid = #eduser.userid#
</cfquery>
<select name="posid" id="posid" multiple size = "6">
<option value = "0">None</option>
<cfloop query="pos">
<option [b]<cfloop query= "currentpos">[/b] <cfif pos.posid is currentpos.posid> selected </cfif> </cfloop> value="#pos.posid#" > #pos.posname#</option>
</cfloop>
</select>