Thanks much Justin, I had gone to the underscore precisely on that premise
but hadn't made the first component a string when I tried the evaluate
yesterday... this should get me there
Michael

-----Original Message-----
From: Justin Scott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 08, 2001 9:45 PM
To: CF-Talk
Subject: Re: accessing form fields with a variable numeric component


> <input type="text" name="quantity,#keyArray[counter]#" value="numeric
> value">
> <input type="text" name="cost,#keyArray[counter]#" value="numeric value">

Creating dynamic variables means...

> <cfquery name="qry_saveissue" datasource="#str_dsn#">
> Insert into issue_values(issue_name,system_key,quantity,cost)
>
>
VALUES('#form.issue_name#',#keyArray[counter]#,#form.quantity,keyArray[count
> er]# ,#form.cost,#keyArray[counter]# )
> </cfquery>

.you need to evaluate() them in the processing code...

<cfquery name="qry_saveissue" datasource="#str_dsn#">
Insert into issue_values(
   issue_name,
   system_key,
   quantity,
   cost)
VALUES(
   '#form.issue_name#',
   #keyArray[counter]#,
   #evaluate("form.quantity," & keyArray[counter])#,
   #evaluate("form.cost," & keyArray[counter])#)
</cfquery>

Also, you cannot use commas in your variable names as CF will have a hissy
fit.  Use a dash or underscore instead.  I left your commas in the
evaluate() example above to demonstrate how it would be done.

-Justin Scott, Lead Developer
 Sceiron Internet Services, Inc.
 http://www.sceiron.com


PS: Your sig says you're a certified developer..  you should know this stuff
already.


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to