Tuesday, March 23, 2010

Passing Dynamic Form Names

I'm trying to pass dynamically generated form names and their
values to an update query. I've tried to pass the form name query
which gives me the form names in the first place, but then I have
to somehow piece together ''form.'' and the dynamically generated
name, which in this case is a unique ID from the database to the
update query fields



%26lt;cfloop index=''i'' from=''1''
to=''#ArrayLen(session.rateOffSiteArray)#'' step=''1''%26gt;

%26lt;cfquery name=''updateRates'' datasource=''rates''
dbtype=''ODBC''%26gt;

update laborRates set

baseOffSite = #form. (...this where I'm having trouble...)#

where ID = #session.rateOnSiteArray
#

%26lt;/cfquery%26gt;

%26lt;/cfloop%26gt;

%26lt;/cfoutput%26gt;
Passing Dynamic Form Names
#Evaluate(''form.#generated_name#'')#

No comments:

Post a Comment