Cliff Meyers wrote:

I have a single form that is generated dynamically based on N records
pulled from a database.  Each row of the form contains roughly 10 fields,
and are named via the following convention...

course0
degree0
emp_course_id0

course1
degree1
emp_course_id1

...

All of these variables are posted to a page that processes the form. There is a hidden form field that describes how many rows were in the form
that helps ColdFusion look for variables. Then it starts a loop, which
does several queries to insert (or update) records in the table. There
there's code like this...


<CFQUERY>
INSERT INTO mytable
(course, degree, emp_course_id...)
VALUES
('#evalate("course" & i)#','#evaluate("degree" &
i)#','#evaluate("emp_course_id" & i)#')
</CFQUERY>

where "i" is the integer index of the loop.  If it were up to me, I
wouldn't design an interface that had one form editing a variable number
of records... but apparently the UI guys think it's too much clicking for
the user to choose a single record from the list and then get a form to
update it. :)


-Cliff


Are you trying to dynamically create variable names and get that variable's data or are you just connotating string togeather?

<cfscript>
   i = 1;
   variables.test = "course" & i;
   variables.course1 = "blah";
   testname = variables["course"&i];
</cfscript>
<cfoutput>
#test#<br>
#testname#
</cfoutput>

testname will get the data from course1. test is just connecting string togeather? I can't tell from your example because things are unscoped...

--
Peter J. Farrell :: Maestro Publishing

blog    :: http://blog.maestropublishing.com
email   :: [EMAIL PROTECTED]

Create boilerplate beans!
Check out the Mach-II Bean Creator - free download.
http://blog.maestropublishing.com/mach-ii_beaner.htm


0341: Outta Antimatter. I told Geordi $50 wasn't enough.

--


---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]




Reply via email to