Simple List Problem
This should be simple but I don't see it. I'm sure there is a work around or a better way to do it but I can't see to find it.
Problem: The check boxes will be checked if it finds the number 1, 4, 6 or 14
What should happen: The check boxes for 6 and 14 should only be checked because the list contains the number 6 and 14 and not 1, 4, 6 and 14.
<cfset AuditionCategory = ListAppend(AuditionCategory, 6, ",")>
<cfset AuditionCategory = ListAppend(AuditionCategory, 14, ",")>
<cfoutput>#AuditionCategory#</cfoutput>
6,14
<cfloop from="1" to="20" index="i">
<input type="checkbox" name="test" value="#i#
<cfif listContains(AuditionCategory, i, ",")>checked="checked"</cfif> />
</cfloop>
What is happening is #1, #4, #6 and #14 are being checked instead of just #6 and #14.
For some reason, it is finding 1, 4, 6 and 14 instead of just finding 6 and 14.
Can anyone tell me what the solution to this problem is? Why is it trying to break apart the number 14 as 1 and 4.
