I have a form that has many fields in the format
- name = "field-1"
- name = "field-2"
- name = "field-3"
- name = "Field-4"
- etc....
On the form's action page, I would like to be able to use the loop and be able to use the loop index for concat with a line prefix like this <cfset newField = "field-" & #index#>, and then use #Variables.newField#to access the form field on the previous page.
I played with the function Evaluate(), but no luck. I don't use ColdFusion very often, so I can just sit a bit in the syntax.
An example of how I use it:
<cfset newField = "form.field-" &
<input type="hidden"
name="field-<cfoutput>#index#</cfoutput>"
value="<cfoutput>Evaluate(Variables.newField)</cfoutput>">
source
share