title: ColdFusion Arrays and Variables
body: <p>Hey guys, I really am stuck here. I keep getting an error on this code and I have absolutely no idea why. Basically what I am trying to do is check a form for a field called quantity_# with # being a number. If it finds it I want to go through all those fields and add them onto a 2 dimension array so I can store the actual value of that field and the number that was on the end. I have tried my code below and it does not work, giving me the error:</p>
  
  <p>When using named parameters to a function, every parameter must have a name.</p>
  
  <p>I have no idea why it is not working, can someone please help? My code is below, thanks.</p>
  
  <pre><code>      &lt;!--- Check if there are multiple quantities ---&gt;
    &lt;cfif ListContains(form.fieldnames, "quantity_")&gt;
      &lt;cfset quantities = ArrayNew(2)&gt;
      &lt;cfloop index="i" list="form.fieldnames"&gt;
        &lt;cfif i contains "quantity_"&gt;
          &lt;cfset product = ArrayNew(1)&gt;
          &lt;cfset product = ArrayAppend(product, form.[i])&gt;
          &lt;cfset product = ArrayAppend(product, ListGetAt(i, 2, "_"))&gt;
          &lt;cfset product = ArrayAppend(quantities)&gt;
        &lt;/cfif&gt;
      &lt;/cfloop&gt;
      &lt;cfset form.quantity = quantities&gt;
    &lt;cfelse&gt;
      &lt;!--- Make it so if the quantity is blank we set it to 0 so it passes validation ---&gt;
      &lt;cfif form.quantity EQ ""&gt;
        &lt;cfset form.quantity = 0&gt;
      &lt;/cfif&gt;
    &lt;/cfif&gt;
  </code></pre>