Skip to content

Rules

Use rules when widget behavior should react to form data, user input, or validation conditions at runtime.

Widget behavior in Emakin forms is governed by rules, which define when widgets are visible, read-only, required, or otherwise formatted dynamically.

Each rule defines a condition and the action to apply when that condition is met. A widget can have multiple rules, and those rules are evaluated sequentially in the order they are defined.

Types of Rules

Formatting Rule

Modifies a widget's appearance based on the value of a data model property. Customizations include:

  • Changing colors, fonts, and visibility.
  • Applying styles such as bold or italic text.

Example: Changing the background color of a text box when a specific condition is met.

Validation Rule

Ensures the accuracy and consistency of form input by validating widget values against specified conditions.

  • Displays feedback when validation fails.
  • Prevents data submission until conditions are satisfied.

Example: Requiring a mandatory field to be filled before proceeding.