Hi, folks!
I am trying to replace the following code on my form action page with a loop:
Here's what I've got so far:
This sets an initial value correctly, but as you can see from my original code, if the box is checked, the varable S/B "Yes", if it is not checked it S/B "No". Later, these values are inserted into the database. I can't seem to set variables dynamically. Is what I'm trying to do possible? I hope so, because this is the easy one. It gets uglier from here.
Thanks!
Calista :-X
Jedi Knight,
Champion of the Force
I am trying to replace the following code on my form action page with a loop:
Code:
<CFIF ISDEFINED("Form.FOPEN") IS TRUE>
<CFSET FOPEN="Yes">
<CFELSE>
<CFSET FOPEN="No">
</CFIF>
<CFIF ISDEFINED("Form.FCLOSE") IS TRUE>
<CFSET FCLOSE="Yes">
<CFELSE>
<CFSET FCLOSE="No">
</CFIF>
<CFIF ISDEFINED("Form.FREAD") IS TRUE>
<CFSET FREAD="Yes">
<CFELSE>
<CFSET FREAD="No">
</CFIF>
<CFIF ISDEFINED("Form.FWRITE") IS TRUE>
<CFSET FWRITE="Yes">
<CFELSE>
<CFSET FWRITE="No">
</CFIF>
Code:
<CFSET FileEventList = "FOPEN,FCLOSE,FREAD,FWRITE">
<CFLOOP INDEX="EventIndex" FROM="1" TO="4" STEP="1">
<CFPARAM NAME="Form.#ListGetAt(FileEventList,EventIndex)#" DEFAULT="False">
</CFLOOP>
<CFOUTPUT>
<CFLOOP INDEX="EventIndex" FROM="1" TO="4" STEP="1">
#ListGetAt(FileEventList,EventIndex)# #Evaluate(ListGetAt(FileEventList,EventIndex))#<BR>
</CFLOOP>
</CFOUTPUT>
Thanks!
Calista :-X
Jedi Knight,
Champion of the Force