Yikes, does ColdFusion even process that <cfif> with that many # symbols??
First, I do have one recommendation for this. I think you have a grid of form fields, and you are basically naming your variables as:
status[row][col] right? If this is the case, it would explain the "weird" behavior of how your form fields are getting submitted.
Basically, there's a problem in naming your fields like that, in which form field names can easily "conflict" by getting the same name. For example:
Row 1, Col 11 =
status111
Row 11, Col 1 =
status111
I'd recommend putting an underscore (or something else) between them. Ex:
status[row]_[col]. This will make it so your form fields come out as this, which will make them each have a unique name:
Row 1, Col 11 =
status1_11
Row 11, Col 1 =
status11_1
--------------------------------------------------------
That being said, checkbox fields themselves are interesting in how they get submitted. If they are checked, they are submitted with the value "on" (or whatever value you have defined on them). If they are not checked, they
don't get submitted at all, which means they will be undefined.
So you should be able to do this:
Code:
<cfif isDefined( form[ "status#i#11" ] )>
#form[ "status#i#11" ]#
<cfelse>
(field was not checked)
</cfif>
I'm not 100% sure that CF7 will process nested # symbols though. It seems to be working on yours, but just in case it isn't:
Code:
<cfif isDefined( form[ "status#i#11" ] )>
#form[ "status" & i & "11" ]#
<cfelse>
(field was not checked)
</cfif>
--------------------------------------------------------
Btw, I just realized that the code I gave you last time needed the & operator instead of the + operator. Here is the same code that should (in theory) work:
Code:
<cfloop from="1" to="50" index="i">
<cfif NOT structKeyExists( form, 'startDateName' & i ) OR form[ 'startDateName' & i ] EQ "">
<cfoutput>Form element #i# is not defined or empty</cfoutput>
<cfelse>
<cfoutput>Form element #i# is defined as: #form[ 'startDateName' & i ]#</cfoutput>
</cfif>
</cfif>
--------------------------------------------------------
Hope that helps. Otherwise, I might need to see your page in action if you have it up on the internet somewhere. Lemme know.
-Greg