Note: Throughout this Help page, form element examples in red indicate form elements that are required for the FPU to work properly. Form element examples in green indicate optional elements.
<form method=post action="https://nautical.uwf.edu/utility/processform.cfm">
Hint: If you want the email to be from the form submitter, so that you can reply to them without having to type their email address, make the mailFrom field a required text field in the form where they can enter their email address. The steps necessary to specify a field as required are described in the section on Requiring Input and Validation.
The hidden elements can go anywhere inside the form tags of your form.
However, it will make your form easier to develop and maintain if you place all
the global (apply to the whole form) hidden tags together and place the tags
applicable to only one field with the field to which they apply.
The standard acknowledgement is a page displaying:
Thank you. Your Submission has been forwarded for processing.
This feedback can be customized using the following three elements:<input type=hidden name="referTo" value="http://anywhere.com">
<input type=hidden name="formName" value="Student Registration">
<input type=textbox name="ccto" size="40">
<input type=textbox name="ccAndFrom" size="40">
The formname element will customize the FPU acknowledgement page by substituting the formName element value for the word "Submission" in the message. Using the value "Student Registration" as in the example above would cause the acknowledgement message to read:
Thank you. Your Student Registration has been forwarded for processing.
The referTo element allows you to send the user to any URL after submitting the form. For example, you could create your own acknowledgement page on your server and use that URL as the referTo value. The referTo element overrides the formName element so that a form submitter would go directly to the provided URL without seeing the FPU acknowledgement. It does not cause a problem to specify both the referTo and formName elements and may be necessary to take advantage of other FPU features.
The ccTo element sends a copy of the email to the associated value.
The example above uses an element type of textbox instead of a
hidden field allowing the submitter
to enter their email address and receive a copy of the resultant email.
Their copy would be identical to the one received by addresses specified in
the mailTo element. The ccto sends a separate email to the specified
address so the recipient does not appear in the cc address line of the email received
by the addressees designated in the mailto field. The ccAndFrom element is
exactly like the ccto, except that it also causes to email to be "from" the email address
supplied. Using the ccAndFrom allows a recipient to reply to the submitter without
having to type in their email address.
If the formOwner element is present, form submissions will be counted
and the date of the last submission recorded in a database. It is recommended
that the formName element also be used because the formOwner and
formName element values are used together to uniquely identify the form.
Then, if you have several forms and give each a different form name, you can
specify the same owner on each form and collect submission counts for each
different form. To view the submission count for forms already using the FPU, click
<input type=hidden name="formname" value="Student Registration">
Submitter Identification and Time Stamping (Tracking)
The identification of the submitter only consists of the Internet Protocol (IP) address. It should not be used in lieu of obtaining name, SSN, or other information. IP addresses can be traced to a specific computer from which the form submission originated so could be used to determine the origin of a submission in case of inappropriate language or threatening submissions. Use of the tracking feature causes the submitter’s IP address and the date and time of submission to be appended to the bottom of the resultant email. Placing the tracking element with a value of "on" as in the example below turns on tracking:
<input type=hidden name="tracking" value="on">
Formatting Email Text
Without applying any of the following email formatting techniques, the email will simply list the form fields and their associated values, one field to a line, in the order they appear on the form. For example,
As described below, the FPU makes it provides extensive email formatting capabilities.
The discussion of formatting elements will refer to this example form:
Which yields this form:
Suppressing Blank Fields
The text of the email containing the form data can be formatted using the suppressBlanks element and other elements which begin with a form element name and then append _heading, _delHd, _delHdAndRtn or _delStr to the end. As discussed in the naming conventions section of the FPU Basics section, suppressBlanks is not prepended with an underscore and therefore applies to the entire form.
Placing the hidden element named suppressBlanks causes any field left blank by the submitter to be omitted from the email. Without suppressBlanks, if the submitter (Bill Smith) omitted his first name, the output would still print the field name, but would print nothing after it like this:
Turning on suppressBlanks like this:
<input type="hidden" name="suppressBlanks">
would suppress printing of ALL element names where no input had been provided (remember suppressBlanks affects the entire form). The output using suppressBlanks would appear as:
The remaining text formatting elements apply only to the form element whose name they reflect.
Continuing to use the fname, lname and dob elements shown above, suppose you wanted to suppress printing of only some headings if the submitter didn’t fill in the form field. The _delStr works the same as suppressBlanks except it applies only to the element whose name precedes the _delStr. For example, to suppress only the dob heading if the submitter left it blank, but still display the two name related headings even if they weren’t filled in would be implemented as follows:
<input type="hidden" name="dob_delStr">
If the submitter filled in only his last name in the form, leaving the first name and date of birth fields blank, the output would look like this:
Besides making the email look nice by selectively leaving out blank fields, suppose you want to polish it a bit by replacing the headings (element names) fname, lname and dob with something easier to read like this:
First name: Bill
Last name: Smith
Date of birth: nn/nn/nnnn
Since you cannot use spaces in form element names, you can’t accomplish this by just naming the elements "First name:", etc. Instead you create a hidden field named fname_heading and set the value attribute to the heading you would like displayed in the email. The value attribute CAN contain spaces, or any of the other special characters that form element names cannot have. The resultant hidden field would look like this:
<input type=hidden name="fname_heading" value="First name:"><br>
The FPU understands fname_heading means it should replace fname with First name: in the email.
Two other FPU formatting options dealing with the heading are _delHdAndRtn and _delHd. Notice in earlier examples of the email output, each form element is printed on a line by itself. In other words, each element is printed out and followed by a return. As you might guess, _delHdAndRtn suppresses printing the heading and the return, allowing multiple values to be printed on one line, whereas _delHd only suppresses the heading. Please note that suppressing the heading only suppresses the original heading, not a heading specified using the _heading element. These two formatting features could be used in combination with the _heading to change a heading and print multiple fields on a single line like:
Full name: Bill Smith
Changing the heading to "Full name:" and putting the first and last names on the same line would be accomplished using the following code:
Lines 1 and 2 will cause "Full name: " to be printed on the first line of the email and the return to be suppressed so the next field will appear on the same line. Line 3 displays a form textbox for the first name. Line 4 tells the FPU to suppress printing the fname heading and to suppress the return after the fname value is printed. Line 5 displays the last name form textbox, lname. Line 6 tells the FPU to suppress printing the heading for the lname element, but leave the return afterward so that dob will be printed on the next line down. Line 7 displays the dob textbox and line 8 says to replace the dob heading with the string "Date of birth: "Top
Requiring Input and Validation
Form field validation is actually inherent in the ColdFusion language so this section provides a brief description of how to use the ColdFusion validation features and provides a link to a more complete discussion in the ColdFusion documentation. Input validation works exactly like the FPU formatting discussed earlier in that it uses a hidden field, named similar to a form field, possibly with a value attribute which provides additional information. The validation provided is twofold. First you can make a field "required", meaning that the submission will be rejected and the user given a message if the field is left blank. Second, it can force the submitter to enter data in a specified format such as date, numeric, or numeric within a specified range.
The format for specifying a field as required is:
<input type="hidden" name="fname_required" value="You must enter your first name.">
The value attribute is not required, however, it is recommended as it can present a more meaningful error message than a generic "An entry is required."
The format for requiring the data to be a date is:
<input type="hidden" name="dob_date" value="This is not a valid birth date.">
ColdFusion will interpret most common date formats as a valid date, for example, 9/1/98; Sept. 9, 1998).
The format for requiring the data to be an integer is:
<input type="hidden" name="ssn_integer" value="you must enter a number for the SSN field.">
A complete discussion is available in the ColdFusion documentation located here.Top
Duplicating Selected Fields
Any form field can be included in a separate block of text that will be appended to the bottom of the email message. The method for identifying fields to duplicate is to create a hidden field, named after the field to duplicate with a _dupTxt suffix. Suppose you want to duplicate the fname element. This can be accomplished as follows:
<input type=hidden name="fname_dupTxt"> Top
The FPU supports forms that allow the submitter to upload a file (size limited to 150KB) and attach it to the email. Use of this feature requires these three steps:
Tips and Tricks