Help ELMA BPM Platform
×
Menu

Value Validation with a Script

Validation means checking any dynamic form element value for changes in a script and displaying errors, if the check failed. To use validation in a processadd a script to a context variable.
Validation can be implemented for one or several fields at the same time.
For simultaneous validation of several fields:
Value validation example
Consider an example of using simultaneous validation of several fields (fig. 1).
Fig. 1. Task settings. Form (context) tab
Add a script to the Password and Confirm Password context variables (fig. 2). To learn more, see the respective Help page.
Fig. 2. Property settings. Additional tab
Attention!
Starting with version 3.11, new methods are used for validating the form script parameter:
form.For(m => m.Field).Validation.Error(message);
form.For(m => m.Field).Validation.Ok();
where:
m => m.Field – indicate the form property, to perform actions for;
Validation.Error(message) – set a message (message string parameter) that the property has not passed the validation;
Validation.Ok() – reset the message and indicate that the property has a valid value.
Note, that Validation.Ok() resets only the messages, set by the Validation.Error(message) method. This method cannot remove the messages, set by other validations (e.g. Fill in the required field).
Fig. 3. Value validation example
Fig. 4. Value validation example
If the values in the Password and Confirm Password fields match, the validation will be passed and the Next button will become available (fig. 5).
Fig. 5.  Value validation example

Copyright © 2006–2019 ELMA