You got the idea. Just cfloop the ids into field names
<cfloop query="ids">
<cfparam name="form.product_#productid#" />
</cfloop>
<cfloop query="ids">
<input name="product_#productid#" value="#form['product_' &
productid]#" ... />
</cfloop>
Then use the same query and loop to parse them in the action template
<cfloop query="ids">
<cfparam name="form.product_#productid#" />
</cfloop>
<!--- form validation here --->
<cfloop query="ids">
<cfquery datasource="myDSN" name="updateProducts">
Update table
Set price = <cfquery cfsqltype=""cf_sql_varchar"
value="#form['product_' & productid]#" />
</cfquery>
</cfloop>
This has nothing to do with your problem but I would consider changing the
price datatype from text to some kind of numeric or currentcy type.
..:.:.:.:.:.:.:.:.:.:.:.:.
Bobby Hartsfield
http://acoderslife.com
http://cf4em.com
-----Original Message-----
From: Jason Congerton [mailto:[EMAIL PROTECTED]
Sent: Friday, May 02, 2008 10:34 AM
To: CF-Talk
Subject: Update multiple Records
Hi
I need to update the price of multiple products using one form i.e
Product Price
Shoes Updateable Text Field
Trainers Updateable Text Field
etc
I was going to name the text field newCost and loop through the list, but i
obviously need to pass the id as well. Would it be best to name the text box
with the id paramenter so each text box is unique? And then loop through the
form results matching the id before inserting the form value??
Jason
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:304646
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4