Assigning multiple results from CFSELECT statements into an array

Discussion in 'Programming' started by obskure22, Jun 8, 2007.

  1. #1
    For example, I have dynamically generated several CFSELECT boxes named Q1, Q2, and Q3. When the CFFORM posts those to the page, they come back as FORM.Q1, FORM.Q2, FORM.Q3. What I'd like to do is populate an array without hard-coding in any values, but I haven't figured out how to do it at all.

    This is what I'm trying to accomplish:

    <CFSET i=1>
    <CFLOOP CONDITION="i LE 3">
    <CFSET ArrayOfInfo=FORM.Q#i#> [This is the line I can't get to work]
    <CFSET i=i+1>
    </CFLOOP>
     
    obskure22, Jun 8, 2007 IP
  2. cfStarlight

    cfStarlight Peon

    Messages:
    398
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <CFSET ArrayOfInfo=FORM["Q#i#"]>
     
    cfStarlight, Jun 8, 2007 IP