Validations

In order to assist developers in the implementation of field validations, a new validation engine has been added to the platform that will significantly reduce the amount of JavaScript that needs to be created to perform validations on Input controls.

The validations can be configured by going into the details of the Type property (See below).

The validations section appears at the bottom of the Type dialog.

Validation OptionDescription
RegexProviding a valid regular expression in this field will cause the platform to evaluate the input value when the form is submitted.  If the regular expression test fails, the Value State of the control will be set to Error and the Value State Message will be set to "Invalid entry" or whatever text has been provided in the Error Msg property.
Script Function

If you require more advanced validations than a regular expression can provide, you can supply the name of a validation function contained within a Script node.

Example
function validateMyValue(evt)
{
  var value = evt.getSource().getValue();
  return value == "Valid Value";
  // returning true indicates validation success
}

In the above example, the function name you would enter into the Script Function field would be:  validateMyValue(evt)

Error MsgYou can provide your own custom error message to be displayed when validations fail.  If not text is supplied, "Invalid Entry" will be displayed.
Validate Search Help ValueChecking this option will ensure that any value entered into the Input field is validated against the values returned in the configured search help.  This ensures that a valid value has been entered even if the Search Help dialog was not used.  
Value RequiredChecking this option will enforce that a value is provided in this field when the user tabs off the field or attempts to submit the form.
Required At Approval LevelThis option works together with the Value Required checkbox.  When the Value Required checkbox is checked, the Required At Approval Level value will be used to determine exactly when the value is required.  This is useful in more complex workflows where a value may not be required at the time of creation however the second or third approval level may be required to supply data.


IQX Business Solutions - FAB 3.10