COLD FUSION FORMS

The ACTION of your form would look like this:

<form name="commentform" method=post action="processform.cfm">

Many hosts have Cold Fusion installed on their servers. One simple use of Cold Fusion is the processing of email forms. The Cold Fusion email form processor has four basic parts.

Cold Fusion Tags

<cfmail ATTRIBUTES>
...
</cfmail>

These identify, to the browser, the beginning and end of the Cold Fusion processor. The basic attributes are: from, to, subject, server. An example of their use is:

<cfmail from="#form.returnaddress#" to="johnny@mydomainname.com" subject="Question About My Site" server="63.119.175.39">

Form Processor

text #form.form element name#

Each form element that is passed to the Cold Fusion processor file has, or should have, a name, e.g. Name, Email Address, etc. These are defined in the form page, e.g.

<input type="text" name="first-name">

The form element name declared by using the name surrounded by pound signs, #, like this:

#form.element-name#

A typical example of how the form entries might be processed is:

Company : #form.Company#
First Name : #form.FirstName#
Last Name : #form.LastName#
Address 1 : #form.Address1#
Address 2 : #form.Address2#
City : #form.City#
Province/State : #form.Province#
Postal Code/Zip : #form.PostalCode#
Country : #form.Country#
Telephone : #form.Telephone#
Email : #form.email#

Next Page To Display

<cflocation url="location">

This tag will send the visitor to the "location" noted, e.g. thankyou.htm.

A sample .cfm file might look like this:


<cfmail 
from= #form.EMAILFIELDNAME# 
to="EMAILADDRESS@SOMEONESDOMAIN.COM" 
subject="EMAIL SUBJECT TITLE GOES HERE" 
server="63.119.175.39">

Company : #form.Company#
First Name : #form.FirstName#
Last Name : #form.LastName#
Address 1 : #form.Address1#
Address 2 : #form.Address2#
City : #form.City#
Province/State : #form.Province#
Postal Code/Zip : #form.PostalCode#
Country : #form.Country#
Telephone : #form.Telephone#
Email : #form.email#

</cfmail>
<cflocation url="YOUR CONFIRMATION PAGE URL ADDRESS">