Toggle menu

Error Message Functions

Document Page Icon

Each of the form fields that display error messages (mainly the input fields) include an "error message function" property. This function can be used to tailor the error message that's displayed by the field, overriding the default error message.

When a field has an invalid value entered into it, the type of error is passed to your function. You can check what the errorType is and display a suitable message.

Error Types

The standard error types and the field that use them are:

FieldError Type
Checkbox
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Checkbox Group
  • MINREQUIRED - the minimum number required
  • MAXREQUIRED - the maximum number allowed
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
  • VALIDATION - guards against the values being manipulated
Code Editor
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Date Picker
  • REQUIRED - the field is required but has been left blank
  • FORMAT - the value doesn't match the required format
  • AFTERDATE - the date is before the required date
  • BEFOREDATE - the date is after the required date
  • RANGE - the date is outside of the preset range
  • VALIDDAYS - the chosen day is not one of the valid days
  • REGEX - the value doesn't match the regular expression
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Date Input
  • REQUIRED - the field is required but has been left blank
  • MISSINGDAY - the day value is missing
  • MISSINGMONTH - the month value is missing
  • MISSINGYEAR - the year value is missing
  • FORMAT - the value doesn't match the required format
  • AFTERDATE - the date is before the required date
  • BEFOREDATE - the date is after the required date
  • RANGE - the date is outside of the preset range
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
iCM Asset List
  • MINREQUIRED - the minimum number required
  • MAXREQUIRED - the maximum number allowed
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
iCM Asset Lookup
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Location Picker
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Multi-select
  • MINREQUIRED - the minimum number required
  • MAXREQUIRED - the maximum number allowed
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
  • VALIDATION - guards against the values being manipulated
Number
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • NUMBERTYPE - the value doesn't match the required type
  • REGEX - the value doesn't match the regular expression
  • MINVAL - the value is less than the minimum
  • MAXVAL - the value is greater than the maximum
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Password
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • REGEX - the value doesn't match the regular expression
  • APPLYSITEPASSWORDRULES - the value doesn't match the password rules
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Password (non-storing)
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • REGEX - the value doesn't match the regular expression
  • APPLYSITEPASSWORDRULES - the value doesn't match the password rules
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Radio Group
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
  • VALIDATION - guards against the values being manipulated
Select (drop-down)
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
  • VALIDATION - guards against the values being manipulated
Text
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • PATTERN - the value doesn't match the preset pattern
  • REGEX - the value doesn't match the regular expression
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Text (non-storing)
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • PATTERN - the value doesn't match the preset pattern
  • REGEX - the value doesn't match the regular expression
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Text Area
  • REQUIRED - the field is required but has been left blank
  • MAXLENGTH - the value is longer than the maximum length
  • MAXLENGTHWORDS - the value exceeds the maximum number of words
  • REGEX - the value doesn't match the regular expression
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Upload
  • REQUIRED - the field is required but has been left blank
  • MULTIUPLOADMAXFILES - the maximum number of files that can be uploaded
  • VALIDATEDFILETYPES - the files are not of the allowed types
  • EMPTYFILE - a zero-byte file has been uploaded
  • MAXFILESIZE - the file is larger than the maximum allowed size
  • MULTIUPLOADMAXTOTALFILESIZE - the combined files are larger than the maximum allowed size
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
Validator
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
WYSIWYG
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)
WYSIWYG (CKEditor)
  • REQUIRED - the field is required but has been left blank
  • VALIDATIONFUNCTION - the result of a custom validation function failing (validation function can also return custom error types)

Examples

These forms use "as you type" validation. Enter some text (or delete it) to see the error messages.

Share this page

Facebook icon Twitter icon email icon

Print

print icon