I have a form which has many fields in the format of
- name="field-1"
- name="field-2"
- name="field-3"
- name="field-4"
- etc....
On the form action page, I would like to be able to use a loop and be able to use the index of the loop to concat with a string prefix like this <cfset newField = "field-" & #index#>
and then use the #Variables.newField#
to access the form field on the previous page.
I've been playing around with the Evaluate()
function, but no luck. I don't use ColdFusion much, so I may just be a little off on the syntax.
An example of how I am using it is:
<cfset newField = "form.field-" & #index#>
<input type="hidden"
name="field-<cfoutput>#index#</cfoutput>"
value="<cfoutput>Evaluate(Variables.newField)</cfoutput>">