Did the trick, thanks.

Koo Pai Lao wrote:

> I do this every day :)
>
> <cfloop list="#foo.ColumnList#" index="index">
> <cfif IsNumeric(evaluate('foo.'& index)>)>
>    <CFSET index = evaluate('form.'& index)>
> <cfelse>
> <CFSET index =  evaluate('form.'& index)>
> </cfif>
>
> you see... evaluate('form.'& index) will tell coldfusion to read it as
> Form.Bahehehe  (if index = bahehehe during that loop)
>
> but a question since your logic is wierd.  your conditions are doing the
> same thing.  WHY?
>
> >From: Douglas Jordon <[EMAIL PROTECTED]>
> >Reply-To: [EMAIL PROTECTED]
> >To: CF-Talk <[EMAIL PROTECTED]>
> >Subject: how to get the name and value of a field
> >Date: Fri, 05 Oct 2001 14:19:59 -0400
> >
> >I created a little utility for myself that spits out inserts, updates,
> >forms, a set of cfparams etc. when passed a dsn and a table name. I
> >thought I'd try to go one better by enclosing the values in the insert
> >and update statements in single quotes when necessary. But in order to
> >do that, I need to access both the column name and the value of a field.
> >Something like:
> >
> ><cfloop list="#foo.ColumnList#" index="index">
> ><cfif IsNumeric(foo.index)>
> >   SET index = form.index
> ><cfelse>
> >SET index =  'form.index'
> ></cfif>
> >
> >It breaks because I don't know how to access the value of foo.index.
> >
> >Does anyone know how to do this? I hope I'm making sense.
> >
> >TIA,
> >
> >Doug Jordon
> >
> >
> >
> >
> >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
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