Search code examples
listcoldfusioncfloop

Output list in cfloop with two variables


I have following code:

<cfloop from="1" to="3" index="i">
    <cfloop list="#FORM.cboStructureLevel_#i##" index="ii" delimiters=",">
        #ii#
    </cfloop>
</cfloop>

The problem is that I want to output the list but I am getting the error "Element CBOSTRUCTURELEVEL_ is undefined in FORM.". It does not recognize the output of #i# in the list in the second cfloop.

How can I output the whole list as declared above?

Thank you for your help.


Solution

  • try to use evaluate function:

    #Evaluate('FORM.cboStructureLevel_#i#')#