Home > Information Technology > Web Services > Web Construction Kit > Macromedia Contribute @ VSU
Creating a ForM that SendS Mail in Contribute
Preparing the form's action file
Step 1
In the root directory of each unit folder on the webserver is a forms directory. In this directory is a file called ProcessForm.php. This file is to be called as the action of the form that you will create.
This file contains a section towards the top that lists the e-mail addresses that you might want to send e-mail to in your department. Please note, this file only has to be edited to add addresses. You will only need this one copy of the file, all the possible e-mail addresses can be added into the file and used as needed.
Navigate to this file by entering the URL in the address bar. This address will be different depending on what the root URL of your department's website is. For example, the URL for the Webservices site is:
http://www.valdosta.edu/it/web/
This means that the address for the form processor file would be:
http://www.valdosta.edu/it/web/forms/ProcessForm.php For forms with the recaptcha security this form will be processform_adv.php. See the bottom of this page for more information.
Once you navigate to this file you will see the following in the Contribute window. (If not in Contribute open this file in your web site editing software.)
Step 2
At this point you will need to have Contribute open this file for you in Dreamweaver. Click on the File menu. Select Actions then select Edit File in External Application in the submenu that appears.

Step 3
At this point Dreamweaver will start up and open the file. If you have not started Dreamweaver up before this you may get a registration screen as well as the choice between Coder and Designer view. Please select Designer.
Click on the Code icon in the upper left of the Dreamweaver window.

Step 4
In the code view you will see a section labeled LIST OF EMAIL RECIPIENTS.
Each of these lines is for an individual e-mail address. When creating the actual forms, you will use the numbers in the brackets to refer to each address. This allows you to set all of the e-mail addresses up at one time and only refer to one copy of this file.

Step 5
Once you have completed adding your e-mail addresses to the file, save and close the file.
Switch back to Contribute and click the Publish button in the toolbar.
Creating the Form
Step 1
Create a new page based on either the level1 or level2 template.
Step 2
At this point you will need to have Contribute open this file for you in Dreamweaver. Click on the File menu. Select Actions then select Edit File in External Application in the submenu that appears.
Step 3
At this point you can begin to build your form. The next several steps will involve the process used to create the form and include a basic set of hidden fields necessary to make it work properly.
Step 4
What this does is set up the base information that is collected for generating the response web page and the email response.
Copy this code into the body tag section of your HTML page.<form action="/yourwebsite/forms/ProcessForm.php" method="POST" name="form name">
<input type="hidden" name="recipient" value="number">
<input type="hidden" name="subject" value="subject of email">
<input type="hidden" name="sender_email" value="email field">
<input type="hidden" name="sender_name" value="name field">
<input type="hidden" name="sort" value="order of the fields">
<input type="hidden" name="required" value="required fields">
<input type="hidden" name="link_url" value="www.valdosta.edu/directory">
<input type="hidden" name="link_text" value="Return to your website">
<input type="hidden" name="exclude_display" value="excluded fields">
<input type="hidden" name="recipient_name" value="who gets the message"><center><h1>Title</h1></center>
Introduction and/or instructions.
Item Purpose form name Descriptive name for the form (can be used in some advanced features, see below). number The number corresponding to the e-mail address to receive the form results. See Step 4, in the section Preparing the form's action file. subject of email The content of the subject of the e-mail that get's sent containing the results of the form. email field This is the field name where the end-user enters out their e-mail address. name field This is the field name where the end-user enters out their name. order of the fields Controls the order in which the fields will show up in the results and the e-mail. Field names separated by commas. required fields Controls which fields are required for form submission to succeed. Field names separated by commas. directory Name of the directory on the server containing your website. your website The name of your website to display in the results screen shown to the user after for submission. excluded fields Field names not to be displayed on the results screen (will be included in e-mail). Field names separated by commas. who gets the message Displays the recipient of the form results messages, used to hide recipient e-mail addresses from public display.
Step 5
Below are various methods to collect information called fields. You will be shown an example of what each will look like and then allowed to copy the code and paste into your own survey. First create a table area for your field:
<table width="500">
Insert code referenced below here.
<tr><td colspan="2"><input type="submit"><input type="reset"></td></tr>
</table>
</form>
Step 6
Now browse through the different types and place them one after another inside the table you created in Step 2.
Input Field
User can enter whatever they wish up to the maxsize in characters. Size changes the width of the field in the survey. Typically used for such things as name, email, phone number, etc.
| Label: |
<tr>
<td>Label:</td>
<td><input type="text" name="field name" size="40" maxsize="40"></td>
</tr>
Text Area
Larger area where respondents can write. Changing the cols and rows options change the size of the box. Typically used for allowing respondents to give opinions.
| Label: |
<tr>
<td valign="top">Label:</td>
<td><textarea name="field name" cols="40" rows="7" wrap="physical"></textarea>
</tr>
Radio Buttons
Respondents can choose only one option from this group. Works like in a multiple choice test. Only 1 answer can be submitted.
| Label: | |
| Value 1 | |
| Value 2 | |
| Value 3 | |
<tr>
<td colspan="2">Label:</td>
</tr>
<tr>
<td>Value 1</td>
<td><input name="field name" type="radio" value="value 1"></td>
</tr>
<tr>
<td>Value 2</td>
<td><input name="field name" type="radio" value="value 2"></td>
</tr>
<tr>
<td>Value 3</td>
<td><input name="field name" type="radio" value="value 3"></td>
</tr>
Check Boxes
Respondents can choose more than one option from a group. Not limited to one like the radio buttons.
| Label: | |
| Value 1 | |
| Value 2 | |
| Value 3 | |
<tr>
<td colspan="2">Label:</td>
</tr>
<tr>
<td>Value 1</td>
<td><input name="field name" type="checkbox" value="value 1"></td>
</tr>
<tr>
<td>Value 2</td>
<td><input name="field name" type="checkbox" value="value 2"></td>
</tr>
<tr>
<td>Value 3</td>
<td><input name="field name" type="checkbox" value="value 3"></td>
</tr>
Selectable Menu
Allows the repondent to choose from a list of items much like check boxes, only in a list format. the selected option is the one shown when the list is first shown to the respondent. To add options, just add options like the Value 2 or Value 3 options below.
| Label: |
<tr>
<td>Label:</td>
<td><select name="field name">
<option value="value 1">Value 1</option>
<option value="value 2">Value 2</option>
<option value="value 3 ">Value 3</option>
</select></td>
</tr>
Step 7
To add the secuirty box to the bottom of the form, insert this section of code into the form before the sumbit value.
<?php
require_once('/web/htdocs/site/security/recaptcha/recaptchalib.php');
$publickey = "6Ld87wAAAAAAAME9Ggg9-MrLg42Iuvq1EAr-Fabb"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
It will look like this:

For this feature a new version of the Process Form is needed. To request one contact webservices@valdosta.edu. If you already have forms with this feature you will just need to make sure the form posts to processform_adv.php
Step 8
At this point you have created a basic form that sends the results to one or more e-mail addresses.
There are several other features that can be used with the new form processing service, however they are beyond the scope of this document. If you would like more information on them, please refer to the ProcessForm 3.0 Manual. Note, this document is a pdf, and as such will require Adobe Acrobat Reader, or some other pdf reader to be viewed.