Default answers and validation

All Forms created in a Master Template or as a QFORM in the KCM/Model Development Kit are subject to validity checks. Value lists and lengths are enforced whenever possible.

The validation uses the following principles:

  • default values that violate constraints are presented to the user who has to provide a valid answer.
  • any question that presents a list of choices to the user must have valid defaults from that list. KCM Core automatically updates the defaults as described in this section.
  • any question that is hidden or read only cannot be changed by the user.

Length attributes are only enforced on the user entered content. Answers from a choice list are excluded from validation.

Dates and times are only validated on the user entered content. Invalid answers selected from a choice list, such as selecting February, 29 in a non leap-year, are still accepted.

Questions that are unconditionally hidden or are in a group that is unconditionally hidden are not validated. Questions in a group that are conditionally hidden based on other questions are validated. If the answer is invalid, the question is shown to the user for correction. You can disable this validation with the keyword GROUP_STATE on the statement FORM or through the global setting IgnoreUnseenGroups in the KCM Core Environment.

All choice lists must have a valid default even if the questions are read-only or hidden. If the default in a single select list is invalid, KCM Core selects the first entry from the list. If the default in a multi-select list is invalid, KCM Core strips all invalid items from the list. This change provides consistent behavior for read-only questions which are visible to the user but cannot be changed.

You can configure KCM Core at the level Environments to disable answer validation.