2 Domain Hosting

Web Site Design | Web Site Promotion | Web Hosting | Domain Name Registration

Forms - Hidden Optional Form Fields

In addition to the five required hidden form fields, there are optional form fields available with the UWEC Forms Processing Script. These optional fields are not visible to the user, and allow form developers to require that users fill in certain form fields, redirect users to a certain URL, or obtain information from users' environment variables, such as what web browser they were using when they visited the page.

The UWEC forms scripts have the ability to send form results to multiple recipients more easily, send automatic courtesy messages, and store the form results in a data file that can be imported into a Word table, Excel spreadsheet, Access database table, or other program.

This document will cover the following sections on forms processing:

Other documents regarding forms which you may find helpful include:

return to topDefining the Hidden Optional Form Fields

This section briefly defines the optional hidden form fields. The next section, Inserting the Optional Hidden Form Fields, gives instructions and examples of values to be used. The optional hidden form fields can be divided into the following categories:

General

Require completion of fields
          The required and missing_fields_redirect  fields can be used to force specific completion of specific fields. The missing_fields_redirect can pull up a developer-designed error page. 
Redefine the "Results" Page
  Instead of displaying the default results page, you can redirect the user to a page of your choosing, perhaps a thank you page.
Generate Environment Report 
  The env_report 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.

Share the Results

  Use the cc and bcc field to share the form results with multiple people.

Generate a Custom Email Reply

  Use the courtesy reply fields to customize a email that is automatically generated to the user that completed the form. Fields include:
courtesy_reply
courtesy_reply_texta
courtesy_reply_textb
courtesy_who_we_are
courtesy_our_url
courtesy_our_email

Capture Results to a Data File

  Reduce the data entry and capture the results to a file with the following fields:
append_db
db_fields
db_delimiter

return to topHidden Optional Form Fields: Values

Before inserting the optional hidden form fields into your form, you must first know the values to be used. The following table illustrates each hidden form field's name and value.

Name of Hidden Form Field

Value

General

 

required The value is the name(s) of any form field(s) a form developer would like to be required (e.g., email, realname), separated by commas if more than one form field will be required. NOTE: Field names are case sensitive, so be careful that values here match the field names used in the visible form fields.
redirect The value is the URL of the page you want to redirect the user to.
NOTE: You must use the absolute URL (http://www.uwec.edu/yourdirectory/yourpage.htm)
missing_fields_redirect The value is the URL of the web page users are redirected to when they have not filled in required fields.
NOTE: You must use the absolute URL (http://www.uwec.edu/yourdirectory/yourpage.htm)
env_report The value is the name(s) of the environment variable(s) you would like to use, separated by commas if you use more than one.
Names of Environment Variables
REMOTE_HOST
Sends the hostname of the user (e.g., uwec.edu)
REMOTE_ADDR
Sends the internet protocol (IP) address, the unique number of the user's computer on a network or the internet (e.g., 137.28.143.226)
HTTP_USER_AGENT
Sends the type of  browser the user is running

Share the Results

cc The value is the email address of the person you would like a carbon copy to go to (e.g., username@uwec.edu).
bcc The value is the email address of the person you would like a blind carbon copy to go to (e.g., username@uwec.edu). A blind carbon copy prevents email recipients from viewing each other's email address.

Generate a Custom Email Reply

Below are the fields for the courtesy email reply options.
courtesy_reply The value entered is the word 'yes'.
courtesy_reply_texta The value entered is the first line of your courtesy reply text (e.g., Thank you for taking the time...).
courtesy_reply_textb The value entered is the second line of your courtesy reply text (e.g., Call us if you need anything...).
courtesy_who_we_are

The value entered is how you would like to be identified (e.g., CNS Web Dev).
 

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

courtesy_our_url The value entered is a URL which will be inserted in the footer of the automated reply (e.g., http://www.uwec.edu/yourdir/).
courtesy_our_email If you want to put your mailto address in the footer of the reply, enter that value here (e.g., web@uwec.edu).

Capture Results to 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 strongly recommend that anyone wishing to use these options be familiar with importing files with delimiting characters.  

NOTE: To implement this option, you need to first establish a special forms data directory in which to store the file. Send an email message to web@uwec.edu with:

  • Your name
  • Web Publishing Account Name
  • Names of those needing access
  • Email names of those needing access
  • Whether Windows or Macintosh access is needed

You will receive a confirmation email message when the forms data directory has been created that will tell you the name of the share to map to so you can create the initial file and retrieve the data, and the directory name to use.

append_db If you wish to append the form fields to a text file, the value should specify the path and file to hold the data. (e.g., directoryname/filename.txt).


NOTES
:  
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.

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 Specify exactly which fields are appended to the text file (e.g., realname,email,phone). Any field not specified in db_fields will not be appended to the file.  Date and time fields are also automatically inserted in front of the rest of the fields in each record.
db_delimiter

This is the separator character used between fields in the text file. Avoid using common characters, like ":", "@", or "/". We recommend using characters that are less likely to be entered in by users ( e.g., %  ^  ; | ).  You could also use the tab key as the delimiter.  To use the tab key just put the cursor between the quotation marks in the value field and hit the tab key.
 

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

return to topInserting the Hidden Optional Form Fields

  1. Open the file that contains your form or create your form

  2. Place your cursor within the form boundary where you would like to insert the hidden form field

  3. From the Insert menu, select Form Objects » Hidden Field
    OR
    From the Forms tab on the Insert bar, click HIDDEN FIELD hidden field button
    The hidden field will appear.
  1. Select the hidden field by clicking it once hidden field icon
    The Hidden Field properties pane appears.
    hidden field properties pane

  2. In the Hidden Field text box, type the name for the hidden field

  3. In the Value text box, type the appropriate value for the hidden field

  4. Repeat steps 2-7 until you have entered all the needed hidden form fields

For required form fields: a form won't submit if a user does not fill in a required field. This can be avoided by having the default value for the form field property name-value pair BLANK.

For redirect form fields: a form will submit if it is completed properly or if there is a default value in a required form field.

Articles

Domain Name Registration - Free Web Hosting Email Tips and Tricks -  Home Based Web Business - Work at Home - Chat Rooms  - Voice Chat - Cell Phone - Phone Calls - Love Dating - Online Dating Services