I wonder if Raymond dreams evaluate? :) ----- Original Message ----- From: Raymond Camden <[EMAIL PROTECTED]> Date: Tuesday, April 9, 2002 10:00 am Subject: RE: is this even possible?? Loop using lists?
> Ack! Evaluate police! > > You do not need to use evaluate to get dynamic form names. Just use > bracket notation. > > <cfset thisName = form["name#i#"]> > etc. > > ======================================================================= > Raymond Camden, Principal Spectra Compliance Engineer for Macromedia > > Email : [EMAIL PROTECTED] > Yahoo IM : morpheus > > "My ally is the Force, and a powerful ally it is." - Yoda > > > -----Original Message----- > > From: BEN MORRIS [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, April 09, 2002 11:53 AM > > To: CF-Talk > > Subject: Re: is this even possible?? Loop using lists? > > > > > > Since you are already using digits in the form field names, > > you can just loop through the number of items, like: > > > > <cfloop from="1" to="10" index="i"> > > <cfset ThisName = Trim(Evaluate("form.Name#i#"))> > > <cfset ThisAge = Trim(Evaluate("form.Age#i#"))> > > <cfset ThisGender = Trim(Evaluate("form.Gender#i#"))> > > <!--- You should probably do an if to make sure the values > > are not null ---> > > <cfquery ...> > > INSERT INTO .... > > .... VALUES ('#ThisName#', '#ThisAge#', '#ThisGender#'... > > </cfquery> > > </cfloop> > > > > >>> Jeff Fongemie <[EMAIL PROTECTED]> 04/09/02 11:46AM >>> > > Hello cf-talk, > > > > Is this even possible?? > > > > I have a form, that collects name, age, and gender, for a list of > > people. I get the it all as a form submission as in form.name1, > > form.age1, form.gender1, form.name2, form.age2 and so on. > > > > What I need to do, is create a new record in a parent table, > to hold > > some other stuff for the transaction, then add each name, age and > > gender as a new record into a child table. THe parent record and > > each child record share a customerID. > > > > The parent table is easy, but I'm having trouble getting a > loop to > > run through and insert each name,age,gender combo as a new > record in > > the child table. > > > > This is my attempt: > > > > > > ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists