Dylan suggestion was one of two techniques I've used. You can name the
fields dynamically using the ID of the record as a prefix:
<INPUT NAME="ID" VALUE="12">
<INPUT NAME="12_Address" VALUE="">
<INPUT NAME="12_City"> VALUE=""...
The other thing I've done is leave the names alone and use the fact that
same-named variables will result in a comma separated list of values. So
as long as you have an ID field (usually hidden) with a list of IDs, you
can use ListFind and ListGetAt to pick all the values for that ID from all
the fields. Two major caveats however with that method. 1) You can't have
commas in the data and 2) Empty fields do not have a "placeholder" comma.
I've never been able to get past #1 because there's no way to access the
data (to replace commas) before it comes a formfield...
> I need to pull a number of records at once from a database, edit them on
> one page, then send the data back to the database. Looping over the query,
> I've been able to place the data correctly on the page.
>
> However, I'm at a loss as to how to update the edited records back into the
> database. I'm currently trying to post them as form data but it fails
> because each record's input fields have the same name.
>
> Is there a way to loop over form data or to dynamically rename form fields?
> And/or is there a better way to edit multiple records at once than by using
> a form?
>
> Thanks for any help,
> Les
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists