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:

Query code
*****************************
name="jss"
SELECT SUBCAT
FROM JSS
ORDER BY SUBCAT ASC
                

Form code
******************************
<tr><cfoutput query="jss"><td>#SUBCAT# <cfinput type="checkbox" name="#SUBCAT#" 
checked="no" value="1"></td></cfoutput></tr>


Form validation & SQL input query code
************************************************
<cfoutput query="jss">
<cfset hello = "FORM.#SUBCAT#">
<cfif #hello# eq '1'>
<cfquery name="insert_details">
INSERT INTO METADATA (ID, KEY, VALUE)
VALUES ('#ID#', '#JSS_SUBCAT#','#hello#')
</cfquery>
</cfif>
</cfoutput>
                

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


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies 
around the world in government.  Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287440
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to