Thanks for the response. The "Q#QuestionID#" is the name of the answer choice in my test which the user has selected. I added the "Results" query because everytime I ran the form it would complain about "QuestionID" being undefined in the form (why I don't know, because "Q#QuestionID# is the name of my input fields).
>For one thing, you have too many pound signs. > ><cfset mylist = listappend(mylist, #FORM[ 'Q#Results.QuestionID#' ]#)> > >Should be > ><cfset mylist = listappend(mylist, FORM[ "Q#Results.QuestionID#" ])> > >Where is "Results.QuestionID" coming from? If you're using this code >inside of a loop for a query result, you either need to put that value >in a local variable or explicitly name the row. > >Results.QuestionID[CurrentRow] > > > > >-----Original Message----- >From: Joel Watson [mailto:[EMAIL PROTECTED] >Sent: Tuesday, March 06, 2007 8:53 AM >To: CF-Talk >Subject: Re: Insert Looped Form Entry into Database > >Thanks for the quick response! This does work, but now I am running >into another problem. While it submits the right number of entries to >my database (in this case, 7), it submits the same value for all (e.g., >Havanna, Havanna, Havanna, Havanna, Havanna, Havanna, Havanna). Here is >the code that I am using: > ><cfif isDefined("FORM.Submit")> ><cfdump var="#form#"> ><cfparam name="mylist" default=""> > <cfloop from="1" to="#Test.RecordCount#" index="i"> > <cfset mylist = listappend(mylist, #FORM[ >'Q#Results.QuestionID#' ]#)> > </cfloop> ><cfquery datasource="Test"> >UPDATE Users > SET AnswerID = > '#mylist#' > WHERE Username = "existdissolve" ></cfquery> ></cfif> > > >The loop gives me the correct number of entries, but does not separate >the values. If I do a straight loop of the query "Results," it enters >all the values, but duplicates each value per the number of answer >options available. > >Again, I really appreciate both your guy's help! > >Joel > > >dynamically ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & Flex 2. Free Trial http://www.adobe.com/products/coldfusion/flex2/ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271705 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

