17.5.  Validation.xml Tags

Various tags are used within the Validation.xml file to describe validation rules. The following describes each tag in detail:

Table 17.1. Validation Tag Details

Tag NameDescription
formsetThis tag is used to support i18n. Suppose that a form is to be validated and that a field within this form is a postal code. Depending upon the locale, this postal code could have very different formats (US/Canadian/German). Multiple formset tags can be defined and each, can be associated to a different locale. Association may be defined using either of the following attributes:
  • country

  • language

If an un-specified locale is requested, the default (no attributes) formset entry is executed.
formThis tag corresponds to the value of the dbform tag 'formValidatorName' attribute.
field This tag identifies the table field. (refer to dbforms-config.xml)
depends Defines which type(s) of validation(s) are required for the field.
msgThis tag specifies the error message to display if the validation fails. The following attributes are required:
  • name

    Specifies validation type.

  • resource

    Determines if the key should be resolved using i18n.

  • key

    If 'resource = false': Corresponds to error message.

    If 'resource = true': key is used to lookup error message in appropriate resource bundle.

argIs used to pass arguments to messages. The following attributes are required:
  • name

    Specifies validation type.

  • resource

    Determines if the key should be resolved using i18n.

  • key

    If 'resource = false': Argument sent as is.

    If 'resource = true': key is used to lookup error message in appropriate resource bundle.

varDefines variables for use in validation.