Not sure why I didn't think of that before, considering I use that sort of
syntax in mountains of other code I've written - ugh :) Thanks! I'll
give that a try...
-Cliff
On Tue, April 26, 2005 3:22 pm, Dave Merrill said:
> Try constructions like this:
>
> form["course" & i]
>
> Dave Merrill
>
>> 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
>
>
>
>
> ----------------------------------------------------------
> 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]
>
>
>
----------------------------------------------------------
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]