You are here: Reference Guides > Designer Form Controls (A-Z) > Ws.FormValidation

Ws.FormValidation

The Ws.FormValidation control can be used to validate data that a user enters into a form. Regular expressions and comparison operations can be configured, and server-side code can be written to do custom validations if the existing functionality does not meet your needs. The regular expression syntax is standard, and references to the regular expression syntax can be found in numerous places on the Web.

Download example (.wssln file)

**Validation will not run until the user submits the form to the workflow (i.e. clicks Save and Route).

Ws.FormValidation properties

Property

Description

Comparisons

  • Field 1: leftmost field in the comparison.
  • Comparison: the comparison operator.
  • Field 2: rightmost field in the comparison.
  • Message: the message to display if the comparison validation fails.

Ordinal

The order in which the validator control should run.

Plug-in Validator

  • Assembly: fully qualified name of the assembly from which to load the server-side validator.
  • Class: fully qualified name of the class that must implement the Ws.PluginHelper.IFormValidator interface.

Regular Expressions

  • RegExp: regular expression to use in validating the field.
  • Field: the name of the field to validate.
  • Message: the message to display if the field’s value does not match the regular expression.

TIP: You can find regular expressions on the Web to validate just about anything. Open your favorite search engine and enter the type of expression that you want—for example, if you want an expression to validate an email address, search for "Regular expression for email address". It also provides many expressions and includes ratings for the expressions, in addition to showing you what will fail and what will pass. (See the example below).

Configuring the Ws.FormValidation Control

Back to top

First, add the Ws.FormValidation control to your form. Right-click the control and then select Properties.

Configuring Regular Expressions

Back to top

  1. In the RegExp field, enter your regular expression that you have written and tested
  2. In the Field column, enter the name of the field you wish to validate.
  3. In the Message Column, enter the message that you want displayed to the user if validation fails.

    **If you have more than three validation items, add another Ws.FormValidation control.

Configuring Comparison expressions

Back to top

  1. In the Field 1 column, enter the left most field you want to compare.
  2. In the Comparison column, select the operator required for the expression.
  3. In the Field 2 column, enter the name of the right-most field you want to compare against.
  4. In the Message column, enter the message that you want displayed to the user if the validation fails.

TIP: If you have more than three validation items, add another Ws.FormValidation control.