Summary:
- the insert works.
- the cfc works
the problem is when i add the “_#i#” to the end of the field names!
Detail:
I have a variable amount of form fields that need to be inserted in to the db at the same time, different rows.
so I looped the form and incremented the name of the fields.
so I have title_1, title_2, title_3 etc…
next I wanted to insert them in the database (one submit button) by looping the insert by the amount of form fields.
I’m using ColdFusion Server Standard 8,0,1,195765
The Error:
Invalid CFML construct
I’ve tried all sorts – any suggestions would be much appreciated.
<cfoutput>
<cfloop from="1" to ="#VARIABLES.fieldTotal#" index="i">
<cfset VARIABLES.insert = theObj.the_insert(
the_id = FORM.the_id_#i#
, title = FORM.title_#i#
, author = FORM.author_#i#
, caption = FORM.caption_#i#
)>
</cfloop>
</cfoutput>
All ColdFusion scopes are structures and can be accessed this way.