CODE
<cfif isDefined('form.submitExtraReg')>
<cfif form.extra neq 0>
<cfloop index="i" from="1" to="#form.extra#">
<cfif len(form.extraName_#i#) gt 0 AND len(form.extraEmail_i) gt 0 AND len(form.extraPhone_i) gt 0>
Success
</cfif>
</cfloop>
</cfif>
</cfif>
<cfif form.extra neq 0>
<cfloop index="i" from="1" to="#form.extra#">
<cfif len(form.extraName_#i#) gt 0 AND len(form.extraEmail_i) gt 0 AND len(form.extraPhone_i) gt 0>
Success
</cfif>
</cfloop>
</cfif>
</cfif>
I have a loop that creates up to 8 rows of 3 inputs depending on the choice of a drop down. I need to validate these text input. I want to validate them with a cfloop since I don't know how many there could be. Each input is named with a _# (_1, _2, _3) that indicates the row they are on. It seems I get an error with the above code. CF says the # inside the len is invalid. If I just leave it to _i, it doesn't evaluate it. Is there a way to have it evaluate i?
Error
QUOTE
Invalid CFML construct found on line 69 at column 50.
ColdFusion was looking at the following text:<p>#</p><p>The CFML compiler was processing:<ul><li>an expression beginning with "len", on line 69, column 31.This message is usually caused by a problem in the expressions structure.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.</ul>
<cfif len(form.extraName_#i#) gt 0 AND len(form.extraEmail_i) gt 0 AND len(form.extraPhone_i) gt 0>
ColdFusion was looking at the following text:<p>#</p><p>The CFML compiler was processing:<ul><li>an expression beginning with "len", on line 69, column 31.This message is usually caused by a problem in the expressions structure.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.<li>a cfif tag beginning on line 69, column 26.</ul>
<cfif len(form.extraName_#i#) gt 0 AND len(form.extraEmail_i) gt 0 AND len(form.extraPhone_i) gt 0>