Users Guide

228 | Configuration Dell Networking W-ClearPass Guest 6.4 | User Guide
Argument. Validators such as IsEqual, IsInRange and IsRegexMatch use the argument to perform
validation.
Examples of Form field Validation
Example 1 – To create a form field that requires an integer value between 1 and 100 (inclusive) to be provided,
use the following settings in the form field editor (see "Form Field Editor " on page 215):
The form field will contain an integer value, so you should set the field's type to Integer when you create it.
Use the PHP syntax array(1, 100) to specify the minimum and maximum values for the IsInRange validator.
After saving changes on the form, this value will be internally converted to the equivalent code:
array (
0 => 1,
1 => 100,
)
With these validator settings, users that enter an invalid value will now receive a validation error message:
Furthermore, be aware that blank values, or non-numeric values, will result in a different error message:
The reason for this is that in this case, the validation has failed due to a type error – the field is specified to have
an integer type, and a blank or non-numeric value cannot be converted to an integer. To set the error message
to display in this case, use the Type Error option under the Advanced Properties.