Add a counter
<cfset i = 0>
<CFLOOP Query="GetFields">
<cfset i = #1#+1>
<CFQUERY name="GetValues" datasource="#dsn#">
SELECT #GetFields.FieldName#
FROM #TableName#
WHERE ID=#ID#
</CFQUERY>
<CFSET DefaultValue=evaluate("GetValues.#GetFields.FieldName#")>
<CFINPUT Name="#GetFields.FieldName##i#" value="#DefaultValue#">
</CFLOOP>
David DiPietro
Systems Developer / Engineer
OSU College of Medicine & Public Health
Voice (614) 292-5960
Fax (614) 292-0745
-----Original Message-----
From: Adrian Lynch [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 26, 2002 12:47 PM
To: CF-Talk
Subject: RE: Variable names in CFINPUT
take it out of the cfinput and see what it's producing
-----Original Message-----
From: Thane Sherrington [mailto:[EMAIL PROTECTED]]
Sent: 26 April 2002 17:33
To: CF-Talk
Subject: RE: Variable names in CFINPUT
At 05:16 PM 4/26/02 +0100, Adrian Lynch wrote:
>post more of your code please
I'll have to get it from home. Basically, I have a set of variable names
and values that I get from a query.
So it's something like this:
<CFQUERY name="GetFields" datasource="#dsn#">
SELECT FieldName
FROM Fields
WHERE TableID=#TableID#
</CFQUERY>
<CFLOOP Query="GetFields">
<CFQUERY name="GetValues" datasource="#dsn#">
SELECT #GetFields.FieldName#
FROM #TableName#
WHERE ID=#ID#
</CFQUERY>
<CFSET DefaultValue=evaluate("GetValues.#GetFields.FieldName#")>
<CFINPUT Name="#GetFields.FieldName#
value="#DefaultValue#">
</CFLOOP>
I'd like it to loop through the inputs and create a form, but it gives the
error about duplicate names, even though the names are different (though
the variable name is the same.)
T
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists