Access the FORM struct using array notation:

#FORM[ "Q#QuestionID#" ]# 

This should work the way you expect it to.

......................
Ben Nadel
Certified Advanced ColdFusion MX7 Developer
www.bennadel.com
 
Need ColdFusion Help?
www.bennadel.com/ask-ben/

-----Original Message-----
From: Joel Watson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 06, 2007 7:37 AM
To: CF-Talk
Subject: Insert Looped Form Entry into Database

I have a cfform that is dynamically populated with test questions and
answer choices from a database.  The answer choices are also dynamically
named based upon the id of the question, e.g., input
name="Q#QuestionID#". I am currently able, upon submit, to pass the
values of user-selected answers, producing this:

struct
FIELDNAMES    SUBMIT,Q1,Q2,Q3,Q4,Q5,Q6,Q7
Q1    Mexico City
Q2    Seattle
Q3    London
Q4    Istanbul
Q5    True
Q6    HEre is an essay question
Q7    Here is an essay question
SUBMIT    Submit Test

My question is how do I capture the fieldnames and values (i.e., Q1 -
Mexico City) so that I can place them in a database when the fieldnames
are being dynamically created?  I initially tried an insert
qualification like '#FORM.Q#QuestionID##', but obviously this does not
work as CF complains about "Q" being undefined.  Any ideas would be
greatly appreciated!

Joel



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/

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

Reply via email to