Validating User's Input

Top  Previous  Next

To validate input fields before sending the request to the server we can set Validation properties which are

Required
Is Number
Valid Values
Custom Validation Function
Validation Error Handler

 

Validation_pe

Some input fields have less properties and some have none. For example there is nothing to validate for a CheckBox or "Is Number" and "Valid Values" properties are meaningless for a ListBox.

Required

If value of this property is true user is forced to enter a value.

Is Number

If value of this property is true user is forced to enter a numeric value. The Input field is not validated if there is no value.

Valid Values

You can specify a list of valid values separated with ';'.

Examples:

aaa;bbb;ccc

1;3;5;7

 

You can also specify ranges

1:9;21:29;41:49

 

Custom Validation Function

In addition to validating input fields with the provided functions (Required, Is Number and Valid Values) , you can validate the process fields with your validation functions.

Add a Script element into page and prepare your validation function in it.

CustomValFunc

The custom validation functions receive only one parameter which is the process field object. If the field is validated then the function should return true and false otherwise.

IsValidEmail function above, should be specified in the Custom Validation Function property.