Zefort Forms validation, display and require rules


You can set validation and display rules in Zefort Forms; with help of rules you can control the filling of the form and make sure that the necessary fields have been filled in and the data input matches with the set rules.

  • Display rules – with display rules you can adjust the visibility of a selected field depending on another blocks data input.
  • Value validation – validation rules allow you to control that the set minimum requirements of the field is met.
  • Require rules – Require rules is to ensure required fields will be filled in, if the set conditions are met.
  • Operators – Operators used for comparing the input block value

Display rules

You can set rules for displaying a field on form. The field will be hidden, if the rule is not met.

Add display rule to a block

  1. Click edit (the pencil icon) of the block
  2. Go to tab Rules and open Display rules
  3. Click Add rules group
  4. Select input block, the content of which you want to set as rule
  5. Select operator and wanted value for it
  6. Click the Add button
  7. Add more rules if needed

When you have added display rules, you will see a small eye icon next to the block title. zefort display rules icon

When the input of the field meets the set rules, the field will be displayed on the form.
Vice versa, if the field input doesn’t match the rules, field will be hidden.

zefort forms - display rules

Adding multiple rules

Add another rule in the same group

  • The selected block is shown on the form if ALL the rules in the group are met

Create optional rule group by clicking ADD RULES GROUP

  • The selected block is shown on the form if AT LEAST ONE of the rule groups is met

Example of display rules

Show the field “Credit card number” only if the other field “Payment term” has value “Credit card”:

  • Input block = Payment method
  • Operator = Equals
  • Value = Credit card

zefort forms - display rule example

Value validation

You can add validation rule for a block. With this you can control that the requirements are met when the field is filled in.

Set value validation

  1. Click edit (the pencil icon) of the block
  2. Go to tab Rules and open Value validation
  3. Click Add rules group
  4. Select operator and wanted value
  5. Click the Add button
  6. Add more rules if needed

When you have added validation rules, you will see a small condition icon next to the block title. zefort value validation

Please note that setting value validation doesn’t make the field mandatory: it only checks the input in case the field has been filled. If the field must be filled, you need to set it mandatory in the block’s edit details page.

zefort forms value validation

Adding multiple rules

Add rules in the same group

  • If filled in, the input of the field must match ALL rules of the group

Add optional rule group by clicking ADD RULES GROUP

  • If filled in, the input of the field must match AT LEAST ONE of the rule groups

Example of value validation rules

Personal ID length must be at least 10 marks:

  • Operator = Length greater than
  • Value = 10

zefort forms value validation example

Require rules

With require rules you can keep under control that required fields are filled in before the form can be submitted.

Set require rules

  1. Click edit (the pencil icon) of the block which is required
  2. Go to tab Rules and open Require rules
  3. Click Add rules group
  4. Select the block which data input is checked
  5. Choose operator and value for it
  6. Click Add button
  7. Add more rules if needed

When you have added validation rules, you will see a small condition icon next to the block title. zefort value validation

The requirements are checked before submitting the form: if the set rules are met but the required field hasn’t been filled, a warning message is displayed and submitting the form is disabled.

zefort forms - require rules

Adding multiple rules

Add rules in the same group

  • The field is required, if ALL rules in the rule group match

Add optional rule group by clicking ADD RULES GROUP

  • The field is required, if AT LEAST ONE of the rule groups match

Example of require rules

Filling in fields “Postal code” and “City” is required if field “Street address” has been filled in:

  • Input block = Street address
  • Operator = Length greater than
  • Value = 0

The same require rule is added to both blocks “Postal code” and “City”.

Operators

Operator Explanation
Equals Value is exactly same
Not equal Value is not same
Is not set
Value is empty
Is set
Value is not empty
Length greater than The length of text string
Length less than The length of text string
Greater than Numeric value
Greater than or equal Numeric value
Lesser than Numeric value
Lesser than or equal Numeric value