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?sidebarRsts