<cfset hello = FORM[SUBCAT]> ..:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com
-----Original Message----- From: Hugh Fidgen [mailto:[EMAIL PROTECTED] Sent: Thursday, August 30, 2007 10:25 AM To: CF-Talk Subject: Difficulty with forms and dynamically named variables Hiya, I'm trying to create a query based form which reads it's elements from a database table, then populates itself. Each input element would have be dynamically named via the DB query. Creating the form isn't so bad, but handling the insert query the other side is becoming a headache. I can't figure out how to recreate the dynamic names of the form variables and extract their data for insertion into the DB. If that makes little sense i apologise, but here is an example of what i'm trying to achieve: (removed "<CF" from tags so this posts) Query code ***************************** name="jss" SELECT SUBCAT FROM JSS ORDER BY SUBCAT ASC Form code ****************************** <tr>output query="jss"><td>#SUBCAT# input type="checkbox" name="#SUBCAT#" checked="no" value="1"></td>/output></tr> Form validation & SQL input query code ************************************************ output query="jss"> <cfset hello = "FORM.#SUBCAT#"> <cfif #hello# eq '1'> query name="insert_details"> INSERT INTO METADATA (ID, KEY, VALUE) VALUES ('#ID#', '#JSS_SUBCAT#','#hello#') /query> </cfif> /output> Now obviously at the moment #hello# outputs as "FORM.A1" or whatever the #SUBCAT# variable held. What I need is a way of re-creating those variable names outside of the form structure, and then using these variable names to actually pull the data from the form submission. Thanks a lot for any help, H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287464 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

