First time poster here, so be easy on me.
This seems like an easy enough thing. I think I am just having a brainfart because it's Sunday.
Anyways, I have a form that loops a query that increments form values:
When the form is submitted, I want to loop through a predetermined number and set my variable to something like this, but I can't get it to work:
<cfloop from="1" to="#FORM.number#" index="agi">
<cfset myvar = FORM.value_#agi#>
I am sure it is just a syntax issue, but like I said, it's Sunday
The FORM scope is like a structure. So you can use array notation to access dynamic field names:
myvar = FORM["baseName_"& dynamicPart]
ie myvar = FORM["value_"& agi]
Thanks! That works beautifully.
You are welcome... and Happy Sunday