mkt wrote:
> OK, I figured out my loop error - I replace my where
form.rec_id with 'i' and
> it worked except now, it placed all the data in each
record. Such as record id
> 1 field csd_focus has test1, test2, test3, test4 verses
just test1. Any
> suggestions?
>
You are using the same form field name for each instance of
the data.
In HTTP this means the data is returned as a list in the form
submit
request. You could use listGetAt() type functionality to loop
over your
form fields and pull each item out individually, but the HTTP
request
does not guarantee the order of the list, and there is a
small chance
that the record items may not match up.
What most developers do is dynamically name the form fields
so that you
can tell which ones belong together. When you do this you
will get form
fields like this:
CSD_FOCUS_1 = test1
CSD_FOCUS_2 = test2
CSD_FOCUS_3 = test3
CSD_FOCUS_4 = test4
CSD_POSITION_1 = Preferred Vendor
ect.
You can now be confident that all the '_1' fields belong to
the same
record. You then can use array notation and string
concatenation to
access the data with a loop.
<cfloop .... index="i">
<cfoutput>
#form['CSD_FOCUES_' & i]# - #form['CSD_POSITION_' &
i]# ...
</cfoutput>
</cfloop>
HTH
Ask away if you need further clarification.