Guest_imported
New member
- Jan 1, 1970
- 0
I have a form that will be utilized to input multiple records at the same time. As I could not have the input form fields named the same, I created a counter and appended the counter value each time after going thru the cfquery loop to the end of the field name.
As so:
<cfset icount=0>
<cfloop query="qry_ins_apft_rslts">
<TD class=ssiTINYTEXT>#qry_ins_apft_rslts.CO##qry_ins_apft_rslts.REGT#</TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_dt#iCount#" value="#dateFormat(form.txt_tst_dt)#" size="7"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_pushup_raw#iCount#" value="0" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_situp_raw#iCount#" value="0" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_run_raw#iCount#" value="00:00" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_rmks#iCount#"></TD>
<TD><input type="hidden" name="test_cd" value="#varTest#"></TD>
<TD><input type="hidden" name="count" value="#qry_ins_apft_rslts.recordcount#"></TD>
</TR>
<cfset icount = #icount# + 1>
</cfloop>
Problem is:
How do I decipher the form fields on the forms processing page? I do not understand how the forms collection is indexed.
It's just a bunch of testing at the moment, but here's what I'm trying: CAN YOU PLEASE HELP ME ITERATE THRU THE FORMS COLLECTION TO RETRIEVE MY SUBMITTED FORM VALUES!!!
<CFSET myarray = arrayNew(1)>
<cfloop collection="#Form#" Item="VarName">
<cfoutput>
<CFSET temp= arrayAppend(myarray, "#Form[VarName]#"
>
</cfoutput>
</cfloop>
<CFSET myList=arrayToList(myarray, ","
>
<CFSET myarray = ListToArray(myList)>
<CFLOOP INDEX="Element" FROM="1" TO="#ArrayLen(myarray)#">
<CFOUTPUT> Element #Element#: #myarray[Element]#<BR></CFOUTPUT>
</CFLOOP>
As so:
<cfset icount=0>
<cfloop query="qry_ins_apft_rslts">
<TD class=ssiTINYTEXT>#qry_ins_apft_rslts.CO##qry_ins_apft_rslts.REGT#</TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_dt#iCount#" value="#dateFormat(form.txt_tst_dt)#" size="7"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_pushup_raw#iCount#" value="0" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_situp_raw#iCount#" value="0" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_run_raw#iCount#" value="00:00" size="5"></TD>
<TD class=ssiTINYTEXT><cfinput type="Text" name="txt_rmks#iCount#"></TD>
<TD><input type="hidden" name="test_cd" value="#varTest#"></TD>
<TD><input type="hidden" name="count" value="#qry_ins_apft_rslts.recordcount#"></TD>
</TR>
<cfset icount = #icount# + 1>
</cfloop>
Problem is:
How do I decipher the form fields on the forms processing page? I do not understand how the forms collection is indexed.
It's just a bunch of testing at the moment, but here's what I'm trying: CAN YOU PLEASE HELP ME ITERATE THRU THE FORMS COLLECTION TO RETRIEVE MY SUBMITTED FORM VALUES!!!
<CFSET myarray = arrayNew(1)>
<cfloop collection="#Form#" Item="VarName">
<cfoutput>
<CFSET temp= arrayAppend(myarray, "#Form[VarName]#"

</cfoutput>
</cfloop>
<CFSET myList=arrayToList(myarray, ","

<CFSET myarray = ListToArray(myList)>
<CFLOOP INDEX="Element" FROM="1" TO="#ArrayLen(myarray)#">
<CFOUTPUT> Element #Element#: #myarray[Element]#<BR></CFOUTPUT>
</CFLOOP>