Return to last viewed topic Go to previous topic Go to next topic
Send us documentation feedback Technical support Learning Center Print topic

Working with HTML Forms


Steps for Applying Validation Rules to a Form Field

To apply a validation rule to a form field, follow these steps.

  1. Perform steps 1-4 in Creating a Form's Content Block.
  2. Insert a text field, text area field, or a selection list.
  3. Click the form element you just inserted so that it is surrounded by small squares.

  1. Click the Set Validation button ( ) from the form element toolbar.
  2. The Form Validation Rules window opens.

  1. Select from the drop-down list a validation rule to apply to the form element.

The following table explains validation rules, and the fields to which you can apply each rule.
Validation Rule
Can be applied to...
When applied, data in the field must...
Valid Examples...
No Validation
  • Text field
  • Text area field
  • Select list field
No validation is applied

Cannot be blank
  • Text field
  • Text area field
Contain text or numbers. Field cannot be left blank.
anything
Numeric Only
Text field only
Contain only numbers, no text
1248361
Text Only
Text field only
Contain only text, no numbers.
yada
Date Only
Text field only
Conform to a date format. For example, mm/dd/yy or mm/dd/yyyy
03/02/80
08/29/2002
Email Type Only
Text field only
Be a valid email address
ajo@company.com
Credit Card Validation
Text field only
Be a valid credit card number
VISA: 4111 1111 1111 1111 (16 digits)
MC: 5500 0000 0000 0004 (16 digits)
AMEX: 340000000000009 (15 digits)
DC: 30000000000004 (14 digits)
DIS: 6011000000000004 (16 digits)
Social Security Number
Text field only
Be a valid social security number
123-45-6789
123456789
U.S. Postal Codes (2 Letter state)
Text field only
Be valid U.S. state postal code
NH
MA
U.S. Zip Codes
Text field only
Be a 5 digit U.S. zip code, or zip+4.
12345
12345-6789
U.S. & Canadian Phone Number
Text field only
Match the U.S. or Canadian phone pattern.
(123) 456-7890
(123)456-7890
Canadian Postal Code
Text field only
Match the Canadian postal code format.
Z5Z-5Z5
Z5Z5Z5
Time
Text field only
Be in a valid time format.
HH:MM, HH:MM:SS, HH:MM:SS.mmm
12:45
12:45:05
12:45:05.052
IP Address
Text field only
Be in a valid IP address format. For example, 999.999.999.999
192.168.0.1
255.255.255.255
Dollar Amount
Text field only
Be in a valid dollar format.
100
100.00
$100
$100.00
Canadian Social Insurance Number
Text field only
Be in a valid Canadian social insurance number format.
999999999
123456789
Number of Characters
Text area only
Adhere to the max/min settings specified.

Cannot be first option
Select list only
Not be the first option on the selection list

  1. Enter an error message. This message appears if the user's input does not conform to the validation rule.


Tip!

If you apply validation rules to more than one field, include the field name in the error message. For example, enter The name field only allows text. This is good practice because error messages only appear after the form is submitted and, if the message does not identify the field, the user may be unable to identify which field needs correction.


  1. Click the Save button to save changes.

Send us documentation feedback Technical support Learning Center Print topic Return to last viewed topic Go to previous topic Go to next topic