alterErrors

alterErrors (args)

args is a dictionary with the following keys:

  • val - The current value of this field
  • field_name - The name of this field
  • require_valid - Errors, if any.
  • def - This element’s definition.

This callback is called when checking the error state of a field. It allows you to intercept the error and alter it.

An error should take one of the 2 following states:

  • false - There is no error
  • string - Text description of error