Question
cfloop question/help
I have the following cfloop in my action page. It is not
working so I put in cfouput to see what values are returned.
<cfif isDefined("form.fieldnames") and mid(form.fieldnames,1,4) is "Del_">
<cfloop index="i" list="#form.fieldnames#" delimiters=",">
<cfoutput>loop is from i, list is #form.fieldnames#<br></cfoutput>
<cfif left(i,4) is "del_">
<cfset select_urdn_number = removechars(i,1,4)>
<cfset select_urdn_number = #evaluate(select_urdn_number)#>
<cfoutput>evaluate urdn nubmer is #select_urdn_number#<br></cfoutput>
</cfif>
Here is the output I am getting from the cfoutput :
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
evaluate urdn nubmer is 2178
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
evaluate urdn nubmer is 2921
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
The evaluate urdn numbers are correct, I am suppose to get two records, but the last part repeats three times (why ?) and when I query again to display the records, it shows the first one, the the second four times :
URDN 2178 2178
URDN 2921 2921
URDN 2921 2921
URDN 2921 2921
URDN 2921 2921
Why is this happening and what do I need to do to only get the two records ?
Thanks
<cfif isDefined("form.fieldnames") and mid(form.fieldnames,1,4) is "Del_">
<cfloop index="i" list="#form.fieldnames#" delimiters=",">
<cfoutput>loop is from i, list is #form.fieldnames#<br></cfoutput>
<cfif left(i,4) is "del_">
<cfset select_urdn_number = removechars(i,1,4)>
<cfset select_urdn_number = #evaluate(select_urdn_number)#>
<cfoutput>evaluate urdn nubmer is #select_urdn_number#<br></cfoutput>
</cfif>
Here is the output I am getting from the cfoutput :
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
evaluate urdn nubmer is 2178
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
evaluate urdn nubmer is 2921
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
loop is from i, list is DEL_2178,DEL_2921,REGION,SITE,ACTIVITY_TYPE
The evaluate urdn numbers are correct, I am suppose to get two records, but the last part repeats three times (why ?) and when I query again to display the records, it shows the first one, the the second four times :
URDN 2178 2178
URDN 2921 2921
URDN 2921 2921
URDN 2921 2921
URDN 2921 2921
Why is this happening and what do I need to do to only get the two records ?
Thanks
