Inside your cfmail tags, you only need to use this code:
<cfloop index="thisField" list="#Form.FieldNames#">
#thisField#: "#evaluate(thisField)#"<br>
</cfloop>
(just remove the cfoutputs)
Steve
-----Original Message-----
From: Bob Haroche [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 18, 2004 1:24 PM
To: CF-Talk
Subject: Emailing Form.FieldNames results via looping?
I have a form with a lot of fields. I want to email the submitted
results to someone, but instead of coding Form.Field1, Form.Field2,
Form.Field3, etc. to do this, I want to loop over the form structure
to get the values of the submitted fields. I'm using this to do that:
<cfloop index="thisField" list="#Form.FieldNames#">
<cfoutput>#thisField#: "#Evaluate(thisField)#"<br></cfoutput>
</cfloop>
That code outputs what I want but I can't use it within a CFMAIL tag
because I get this error:
"A CFOUTPUT tag is nested inside a CFMAIL tag with no GROUP= or QUERY=
attributes . This is not allowed."
Do I need to convert Form.FieldNames into a query using QueryNew
function, or something else?
Using CF 5. Thanks!
____________________________
O n P o i n t S o l u t i o n s
P.O. Box 694
Occidental, Ca 95465
tel / 707.874.2710
fax / 707.874.2716
web / www.onpointsolutions.com
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

