You want Evaluate; our mailer says :
<cfloop list="#form.fieldnames#" index="current_field">
<cfif listfindnocase(left(current_field, 7), "forward")>
<!--- First add the field name, carriage return and then the
field contents --->
<cfset attributes.message = attributes.message &
Replace(Mid("#current_field#", Find("_", "#current_field#", 1)+1,
len("#current_field#")), "_", " ", "ALL") & ":" & Chr(13) & Chr(10)>
<!--- add the actual field content.. --->
<cfset attributes.message = attributes.message &
Evaluate("attributes." & "#current_field#") & Chr(13) & Chr(10) & Chr(13) &
Chr(10)>
</cfif>
</cfloop>
-----Original Message-----
From: Willy Ray [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 20, 2000 10:48 AM
To: CF-Talk
Subject: Kooky Form Field/List question.
I work on a college campus, and frequently I'm asked by
faculty/staff/students, why they can't just make a form in front page
express and have it send them an email (and we don't have the server
extensions). I have the hardest time explaining what a form handler is, and
how frontpage just can't do it.
So, I decided to make a generic Coldfusion form handler. Something that,
provided it was passed an email address, subject line, and a redirect URL
(for the success message), it would make an email to the address. Ok, this
is the easy part. I have it already. The problem is, I need also to pass
*any form fields* other than the ones required for the email in the body of
the email. Biology is going to need different things on their form than
accounting, see, so I want to make this thing totally generic.
So, here's the problem. I can use the automatically-created FORM.fieldnames
list to get the field names onto the email like this:
<cfloop index="test" list="#FORM.fieldnames#" delimiters=",">
#test# : <br>
</cfloop>
This code puts the names of the form field onto the email. Easy. I can
also test them for whether or not they're one of my required fields, and not
print them if they are. What I can't do is print the VALUE of the form
fields. Make sense? I was hoping I could do something like this:
<cfloop index="test" list="#FORM.fieldnames#" delimiters=",">
#test# : #FORM.#test## <br>
</cfloop>
Yeah, but I can't. Any thoughts?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists