Chris Martin wrote:
> When you do the database update, you'll have to run the select query
> again and then use...
> <cfoutput query="jss">
> <cfset theSubCat = #Evaluate("form." & SUBCAT)#">
> </cfoutput>
Evaluate is almost never, ever needed. SUBCAT is a dynamic key in the
struct FORM. Happily, Coldfusion will evaluate the variable name and
then working inside to out, the reference to that key in the structure.
So all you have to do is #form[SUBCAT]#
You can also use other operators within the structure reference. So say
you had variables named form.foo_1, form.foo_2, form.foo_3 You could
output those as follows:
<cfoutput>
<cfloop index="i" from="1" to="3">
#form["foo_" & i]#<br />
</cfloop>
</cfoutput>
Much cleaner than using Evaluate.
Judah
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion is delivering applications solutions at at top companies
around the world in government. Find out how and where now
http://www.adobe.com/cfusion/showcase/index.cfm?event=finder&productID=1522&loc=en_us
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287497
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4