I have a list L1 of (A,B,C,D,E,F,G) and a second list L2 of
(B,E,G). I want to display a select box of everything in list L1 but with all items in list L2 highlighted.
I don't know how to use Listfind function. The double quotes is where I'm confused.
Here is my code:
<cfset List2=ValueList(ProjTePrefix.proj_prefix)>
<cfset List1=ValueList(PrefixList.proj_type_code)> <cfset aPrefixes = ListtoArray(List1)>
<cfloop index="nLp" from="1" to="#ArrayLen(aPrefixes)#"> <cfset attributes.prefix = aPrefixes[nLp]>
<select name="proj_prefix" size="15" multiple="multiple">
<option
<cfset found = ListFind(List2,"#attributes.prefix#">
<cfif found gt 0>
selected="selected"> #attributes.prefix#
<cfelse>
value="#attributes.prefix#"> #trim(attributes.prefix)#
</cfif>
</option></cfloop>
(B,E,G). I want to display a select box of everything in list L1 but with all items in list L2 highlighted.
I don't know how to use Listfind function. The double quotes is where I'm confused.
Here is my code:
<cfset List2=ValueList(ProjTePrefix.proj_prefix)>
<cfset List1=ValueList(PrefixList.proj_type_code)> <cfset aPrefixes = ListtoArray(List1)>
<cfloop index="nLp" from="1" to="#ArrayLen(aPrefixes)#"> <cfset attributes.prefix = aPrefixes[nLp]>
<select name="proj_prefix" size="15" multiple="multiple">
<option
<cfset found = ListFind(List2,"#attributes.prefix#">
<cfif found gt 0>
selected="selected"> #attributes.prefix#
<cfelse>
value="#attributes.prefix#"> #trim(attributes.prefix)#
</cfif>
</option></cfloop>