This browser does not support basic Web standards, preventing the display of our site's intended design. May we suggest that you upgrade your browser?

HTML Coding

Adding the Optional Form Field

Note: The HTML pages are out-of-date and will not be updated.

In addition to the five required hidden form fields, there are optional form fields available with the UWEC email message script; these optional form fields consist of both hidden form fields that are not visible to the user, and normal form fields, such as text boxes, that are visible to the user. Some of these form fields allow users to specify their return email address, require that users fill in certain form fields, redirect users to a certain URL, or provide a form developer with access to users' environment variables, such as what web browser they were using.

NOTE: Field names are case sensitive, so be careful that values match the field names used in visible form fields.

This document will cover the following sections on form processing:

return to topOptional Visible Form Fields

In order to insert these visible form fields into a form, follow the instructions for Inserting the Optional Visible Form Fields and type the desired form field name listed below (e.g., email, realname) and an optional initial form field value in the Text Box Properties dialog box. Field names are case sensitive. In addition to descriptions of these optional visible form fields, the correct form field names and examples of initial values are shown here.

email
This field creates a one-line text box allowing a user to enter his/her email address. When form developers use this field in a form, the email message they receive containing the form results will be from this user, indicating who submitted the form information and allowing the form developer to reply to the message. In addition, the user's email address will also appear at the beginning of the actual email message (e.g., submitted by studentcr@uwec.edu). 

EXAMPLE:
<INPUT TYPE="text" NAME="email">

NOTE: The value is the initial text that appears to the user in the text box. It will be replaced with the user-supplied value when the form is submitted.

realname
This field creates a one-line text box allowing a user to enter his/her name. When form developers use this field, this user's name will appear at the beginning of the email message containing the form results (e.g., submitted by Chris Student); however, form developers will not be able to reply to the user unless they also use the email field.

EXAMPLE:
<INPUT TYPE="text" NAME="realname">

HINT: If form developers use both the email and realname fields, they will be able to reply to the email message and both the user's name and email address will appear at the beginning of the email message.

return to topOptional Hidden Form Fields

In order to insert optional hidden form fields into a form, follow the instructions for Inserting the Optional Hidden Form Fields and enter the desired form field name listed below (e.g., required, redirect) and a form field value in the Advanced Form Properties dialog box. In addition to descriptions of these optional hidden form fields, the correct form field names and examples of values are shown here.

cc
This form field will allow you to send a copy of the users form data to another address instead of putting multiple addresses in the recipient field.  This will be added to the e-mail as a Cc: field.

EXAMPLE:
<INPUT TYPE="hidden" NAME="cc" VALUE="username @uwec.edu">

bcc
This form field will allow you to send a blind copy of the users form data to another address instead of putting multiple addresses in the recipient field.  This will be added to the e-mail as a Bcc: field.

EXAMPLE:
<INPUT TYPE="hidden"  NAME="bcc"  VALUE="username @uwec.edu">

required
This hidden form field will require that users fill in certain form fields (e.g., an email address text box) before they can submit the form. When users do not fill in a form field specified as a required field, they will be directed to a  new web page when they submit the form, informing them what fields they need to fill in. The names of the required form fields must be entered as the value of this hidden form field.

EXAMPLE:
If you want to require that they fill in the email and phone fields in your form, so that you can reach them once you have received the email, use a syntax like:
<INPUT TYPE="hidden" NAME="required" VALUE="email,phone">

redirect
This hidden form field will automatically direct users to a web page specified by the form developer when users submit a form. Otherwise, users are directed to a default page notifying them that they have successfully submitted the form. The URL that the web page users should be directed to must be entered as the value of this hidden form field.

NOTE: You must use the absolute URL.

EXAMPLE:
To choose the URL they will end up at:
<INPUT TYPE="hidden" NAME="redirect" VALUE="http://www.uwec.edu/yourdirectory/yourpage.htm">

missing_fields_redirect
This hidden form field will automatically direct users to a web page specified by the form developer when users do not fill in a form field that the form developer has specified as a required field. Normally, users are directed to a default web page, informing them what fields they need to fill in. The URL that the web page users should be directed to must be entered as the value of this hidden form field.

NOTE: You must use the absolute URL

EXAMPLE:
To choose the URL they will end up at:
<INPUT TYPE="hidden" NAME="missing_fields_redirect" VALUE="http://www.uwec.edu/yourdirectory/yourpage.htm">

env_report
This hidden form field gives a form developer access to environment variables, which can provide additional information about users, such as what web browser they were using or what domain (e.g., uwec.edu) they were coming from. The form developer will receive this information in the email that contains the form information. The names of the environment variables must be entered as the value of this hidden form field:

EXAMPLE:
If you wanted to find the remote host and browser sending the request, you would put the following into your form:
<INPUT TYPE="hidden" NAME="env_report" VALUE="REMOTE_HOST, HTTP_USER_AGENT">

print_config
This hidden form field allows you to specify which of the config variables, also called the name-value pairs, you would like to have printed in your e-mail message. By default, no config fields are printed to your e-mail, because the important form fields like email and subject are included in the header of the email message. Use this hidden form field if you would like these fields to also be printed in the body of the email message. The config fields that you wish to have printed should be in the value attribute of your input tag separated by commas.

The config variables are:  email, realname, recipient, subject, title, return_link_url, return_link_title

EXAMPLE:
If you want to print the email and realname fields in the body of your message, you would insert the following form tag:
<INPUT TYPE="hidden" NAME="print_config" VALUE="email,realname">

sort
This hidden form field allows you to choose the display order of the name-value pairs in the email that the UWEC email message script generates. You can choose to have them sorted alphabetically or specify a set order in which you want the fields to appear in your email message. When this field is left out, the order will simply default to the order in which the browser sends the information to the script (which is usually the exact same order as they appeared in the form). When sorting by a set order of fields, include the word order: as the first part of your value for the sort field, and then follow that with the field names you want to be listed in the email message, separated by commas.

EXAMPLE: To sort alphabetically:
<INPUT TYPE="hidden" NAME="sort" VALUE="alphabetic">

To sort by a set field order: If you want to print the realname and email fields in the body of your message, you would insert the following form tag:

<INPUT TYPE="hidden" NAME="sort" VALUE="order:name,address,phone">

NOTES:
You cannot have a space between the semi-colon and the first field name in the value attribute.
You cannot have the realname or email fields in the sort list.
Do not put fields in the sort list that are also in the print_config field.

return to topFields for Formatting the Form Results Page

background
This hidden form field allows you to specify a background image that will appear if you do not have the redirect field set. This image will appear as the background of  the form results page.

EXAMPLE:
<INPUT TYPE="hidden" NAME="background" VALUE="/yourdirectory/yourbackgroundimage.gif">

bgcolor
This hidden form field allows you to specify a background color for the form results page in much the way you specify a background image. This field should not be set if the redirect field is set.

EXAMPLE:
<INPUT TYPE="hidden" NAME="bgcolor" VALUE="#FFFFFF">

text_color
This hidden form field allows you to specify a text color for the form results page. This field should not be set if the redirect field is set.

EXAMPLE:
<INPUT TYPE="hidden" NAME="text_color" VALUE="#000000">

link_color
This hidden form field changes the color of links on the results web page. This field should not be set if the redirect field is set.

EXAMPLE:
<INPUT TYPE="hidden" NAME="link_color" VALUE="#0000FF">

vlink_color
This hidden form field changes the color of visited links on the results web page. This field should not be set if the redirect field is set.

EXAMPLE:
<INPUT TYPE="hidden" NAME="vlink_color" VALUE="#339900">

alink_color
This hidden form field changes the color of active links on the results web page. This field should not be set if the redirect field is set.

EXAMPLE:
<INPUT TYPE="hidden" NAME="alink_color" VALUE="#FF0000">

return to topFields for Courtesy Email Reply Options

See the example courtesy email along with its code.

courtesy_reply
This field initiates an automated courtesy reply to the user to thank them for filling out your form.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_reply" VALUE="yes">

courtesy_reply_texta
The first line of your courtesy reply text.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_reply_texta" VALUE="Thank you for taking the time...">

courtesy_reply_textb
The second line of your courtesy reply text.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_reply_textb" VALUE="Call us if you need anything...">

courtesy_who_we_are
Tell the visitor who you are in the courtesy reply footer.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_who_we_are" VALUE="LTS Web Dev">

HINT: A second line can be displayed by having another field with the name: "courtesy_who_we_are2".

courtesy_our_url
Puts a URL in the footer of the automated reply.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_our_url" VALUE="http://www.uwec.edu/yourdir/">

courtesy_our_email
Puts your mailto in the footer of the reply.

EXAMPLE:
<INPUT TYPE="hidden" NAME="courtesy_our_email" VALUE="web @uwec.edu">

return to topFields for Storing Results in a Data File

The last three fields are options that allow you to store your form results in a data file, which can be easily read into a Microsoft Word table, a Microsoft Excel spreadsheet, or even a Microsoft Access database.  We recommend that anyone who wishes to use these options be familiar with importing files with delimiting characters.

NOTE: A special data directory needs to be created to use this option.  Please send an email message to web@uwec.edu with the following:

  1. Name of your web publishing account
  2. Names of those needing access to the file
  3. Indicate whether Windows or Macintosh user

append_db
To append the form fields to a flat file database, specify the filename as the value of this field.  The value should specify the path and file to hold the data. (i.e. "webdev/form.txt")   When using the append to database feature, the initial blank data file must be created on the server prior to using the script.  The script does not automatically create it; it only appends to it.

EXAMPLE: <INPUT TYPE="hidden" NAME="append_db" VALUE="webdev/form.txt">

NOTE: If you plan on using Microsoft Word to view the data file we recommend you use a '.dat' for your file extension instead of '.txt'.

db_fields
Specifies exactly which fields are appended to the database. Any field not specified in db_fields will not be appended to the database. A date and time field are also automatically added to each record.

EXAMPLE:
<INPUT TYPE="hidden" NAME="db_fields" VALUE="realname, email, phone">

db_delimiter
Specifies the separator character to be used between fields in the database. Avoid using characters, like @. We recommend using characters that are less likely to be entered in by users (i.e., % ^ ; |). You could also use the Tab key as the delimiter. To use the Tab key, put the cursor between the quotation marks in the value field and press the [Tab] key.

EXAMPLE:
<INPUT TYPE="hidden" NAME="db_delimiter" VALUE="|">

NOTE: If you use the tab delimiter then your file extension should be '.tab' instead of '.txt' or '.dat'.

Excellence. Our Measure. Our Motto. Our Goal.