re: [ACFUG Discuss] using a variable to build a variable name

2006-10-23 Thread Mischa Uppelschoten ext 10
So you need to process one or more formfields but you don't know the names at the time of processing? I had a similar requirement and here is how I solved it: cfscript for(FormField in arguments.FormVars) // this will loop through all available form variables { Quantity =

re: [ACFUG Discuss] using a variable to build a variable name

2006-10-23 Thread axunderwood
Maybe this can help someone as well. I find this a very easy way to determine what fields you're looking for... First, on the form page, I'll create hidden fields of the same name so a comma delimited list is created on the action page: Display Page: input type="hidden" name="someID"

Re: [ACFUG Discuss] using a variable to build a variable name

2006-10-20 Thread Douglas Knudsen
Try this...I'm assuming you are looping over the invoiceQuery.UPDATEtablename SET InvAmt = cfqueryparam cfsqltype=fillmein value=#form['InvAmt#InvoiceQuery.InvId#'] / WHERE ID= #ID#DKOn 10/20/06, Jeff Howard [EMAIL PROTECTED] wrote: Hey folks, I was wondering if anyone had a solution to an

Re: [ACFUG Discuss] using a variable to build a variable name

2006-10-20 Thread Jeff Howard
DK There is a loop involved by not over that query. It looks like this is the solution I was looking for though. I just passed the form and had it output on the next page (which is where I'll write to the db) and it worked so I'm assuming that I'll be able to write to the db as well. I

Re: [ACFUG Discuss] using a variable to build a variable name

2006-10-20 Thread Bill Lu
Run InvoiceQuery again, then cfloop query="InvoiceQuery" cfset ThisVar="form.InvAmt"InvId cfif IsDefined("#ThisVar#") cfset ThisInvAmt=Evaluate(ThisVar) cfquery name="update#InvId#" datasource=#DSN# username=#USERNAME# password=#PASSWORD# UPDATE tablename SET InvAmt =