Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Field Types

Author: Antony Corsten Reference Number: AA-00372 Views: 3953 Last Updated: 07/24/2009 08:43 AM 0 Rating/ Voters

Field Types

1. General Description

Form Processor Pro 4.1 allows you to create customized data fields, using Form Processor Pro pre-defined field types and calculation fields.

  • To insert a field into form, simply place chosen name using standard form elements, e.g.:
    <input type="text" name="FirstName">,
  • Wherever you want to output field data, simply put in into square brackets, e.g.:
    Dear [FirstName] ! Thank You . etc

2. Field types

You can use field type switches as a prefix for field name, separated by underscore "_". No other underscores allowed in field names.

In Form Processor Pro 4.0 field types can take the following values:

r Required field
e Valid E-mail address
d Digits and decimal point
c Digits, decimal point and leading dollar sign ($) only. (currency)
w Word characters only (A-Z, a-z, 0-9)
s Leading and trailing spaces are removed
n New line characters are removed
m Multiple selections (for checkboxes and radio buttons)


Detailed description of the types:


r
The field must be filled in. If user will forget to fill this field it will be reminded by the script message.
Example:

<input type="text" name="r_Name">

e
The value must look like a valid email address, otherwise user will be informed by the script.
Example:
<input type="text" name="e_eMail">

d
The value may only contain digits (0-9) and decimal point, otherwise, user will be informed by the script.
Example:
<input type="text" name="d_Year">

c
The value may only contain digits (0-9), decimal point and leading dollar sign (this type is often called currency type). If user mistaken it will be informed by the script. Can be used in arithmetic calculations; result will contain dollar sign ($).
Example:
<input type="text" name="c_Price">

w
The value may only contain "word" characters (range of A-Z, a-z, 0-9), otherwise user will be informed by the script.
Example:
<input type="text" name="w_Login">

s
The value's leading and trailing white space will be removed.
Example:
<input type="text" name="s_Command">

n
All new line characters are removed from the value.
Example:
<textarea cols="20" rows="5" name="n_description"></textarea>

m
Used in list box and checkboxes to process multiple selections with one name and put all data into one string.
Example:
<input type="checkbox" name="m_fashion" value="classic">
<input type="checkbox" name="m_fashion" value="casual">
<input type="checkbox" name="m_fashion" value="urban">
If you select all checkboxes in form result is: classic,casual,urban

NOTE
when using PHP version of the script, put the empty square brackets after the multiple selections field name,
for example "m_fashion[]"
Please refer to FPP Learning / Working with Multiple Select Fields for more details.

NOTE
You can combine the switches to take more effect on field values.
Example:
<input type="text" name="res_eMail">
will generate required field (r) with valid e-mail address (e); leading and trailing spaces are removed (s).

3. CAPTCHA feature

If you want to use a CAPTCHA feature on your form to prevent it from scripted submissions and spam, you need to place a special image tag on your form and a special text field named "r_captcha" for user input. You are free with allocating these elements on your form, but make sure you provide your users with a message that they should type the alphanumeric combination from the image into the text field, in order to proceed.

Examples:

<img src="path/to/formprocessorpro.php?captcha" alt="Captcha Image">
<input type="text" name="r_captcha"> Please type the alphanumeric combination from the Captcha Image.

Make sure you link the "formprocessorpro.php" file location correctly. Please note that this feature would work with PHP version of the product only.

4. Arithmetical calculations

To do arithmetic, place the calculation in brackets like [< ... >]. Variables will be filled out before being calculated. Supported operators: "+" - sum, "-" minus, "/" - division and "*" - multiplication.
Examples:

[< [d_age] / 2 >]
Will be given the value of [d_age] divided by 2.
[< ([item1] + [item2] + [item3]) * [tax] >]
Will add up the items and multiply them by the tax rate.

5. Round function

round (value, precision) - will round value to precision decimal point. If default value is set from the _round variable in the form (see Local Form Configuration File for more details) then function can be round (value).
Example:

[<round ([Number], [Digits])>]
If Number = 123.4846 and Digits = 3 then result is: 123.485

6. IF condition

ifcond ((expr1),(expr2),(expr3)) - evaluates and print result to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE

Example:
[<ifcond (([Number1] > [Number2]), ([Number3+10]),([Number3]))>],
Number1 = 125
Number2 = 100
Number3 = 50
Result: 60

NOTE
you can use this function for more sophisticated conditions. For example: if value payment = cc then _browser_out = credit-card-processing.html if not then another condition etc.

7. Read-only fields

Fields in the templates such as [%HTTP_REFERER], [%REMOTE_HOST], [%DATE_GMT] will be substituted with their counterpart environment values. They must begin with a % (percent) sign. You cannot require an environment setting- if it is not set it will be left blank.
See section FPP Learning / Server Variables for more details.

[unique_reference_number] is field that contains unique reference number generated by Form Processor Pro on the form submission. It is used to determine and mark transaction; useful in shopping carts etc. The field contains value kind of 20030409-1013-4109, which is never repeated.