DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Validation RulesΒΆ

Validation rules are a powerful tool to add validation to the form. The rules function will always be used at the beginning of the form and belongs to the FORM object.

It is possible to have multiple validation rules for one FORM object, but the rules have to be added one by one.

Example

rules {
  1 = required
  1 (
    element = first_name
  )
  2 = required
  2 {
    element = last_name
    showMessage = 0
    error = TEXT
    error {
      value = Please enter your last name
    }
  }
  3 = required
  3 {
    element = email_address
  }
  4 = email
  4 {
    element = email_address
  }
}

When a rule is defined, it will automatically add a message to the object the rule is connected with. This message will be shown in the local language and will tell the user the input needs to be according to this rule. The message can be hidden or overruled with a user defined string/ cObject.

The validation will be done by the order of the rules. The validation can be stopped when a certain rule is not valid. By default all validation rules will be processed.