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:
When using named parameters to a function, every parameter must have a name.
I have no idea why it is not working, can someone please help? My code is below, thanks.
<!--- Check if there are multiple quantities --->
<cfif ListContains(form.fieldnames, "quantity_")>
<cfset quantities = ArrayNew(2)>
<cfloop index="i" list="form.fieldnames">
<cfif i contains "quantity_">
<cfset product = ArrayNew(1)>
<cfset product = ArrayAppend(product, form.[i])>
<cfset product = ArrayAppend(product, ListGetAt(i, 2, "_"))>
<cfset product = ArrayAppend(quantities)>
</cfif>
</cfloop>
<cfset form.quantity = quantities>
<cfelse>
<!--- Make it so if the quantity is blank we set it to 0 so it passes validation --->
<cfif form.quantity EQ "">
<cfset form.quantity = 0>
</cfif>
</cfif>