Skip to main content

Terms & Conditions

What is the Form Terms & Conditions?

The terms & conditions form type displays a block of terms text together with an accept checkbox. The exported value is a boolean indicating whether the user has accepted, which can be required through validation before the form is considered complete.

terms-conditions.png

Options

Terms & Conditions text

  • The text shown to the user.
  • Rendered inside a read-only, disabled text area, so it is displayed as plain text. HTML and markdown are not interpreted. Line breaks in the text are preserved, and if the text is longer than the available space the text area scrolls.
  • The text supports localisation; if a translation is available for the current language it is shown instead.
  • There is no default; while this field is empty the widget shows a "Please specify the Terms & Conditions text property" overlay.

Checkbox label

  • The label shown next to the accept checkbox.
  • Clicking either the checkbox or its label toggles acceptance.
  • Supports localisation.
  • The default is Accept Terms & Conditions. If it is cleared, the widget shows a "Please specify the Checkbox label property" overlay.

Setting Mock Field and Own Value

The exported value is a boolean: true when the checkbox is accepted, false when it is not.

  • The own value is set to the boolean.
  • The Mock field receives the boolean value.
  • Writing happens on load, every time the checkbox is toggled, and when an external message changes its state.

Validation

  • If validation is enabled, the field is evaluated against the checkbox state: it is valid only when the checkbox is accepted (checked) and invalid when it is not. This makes acceptance effectively required.
  • If "Show Validation" is enabled in the Error Settings, the validity is indicated by a border around the field.
  • On load, if the stored value is true, the checkbox is pre-accepted and the border is applied.

Sensor Events

All events are prefixed with the form's name (FORM-NAME).

FORM-NAME

  • Triggered when the field writes to the Mock DataSource (initially and on every change).
  • Value is the boolean acceptance state.

FORM-NAME-valid

  • Triggered when the field is validated, which only happens when validation is enabled.
  • Value is true when accepted, false otherwise.

External Messages

The terms & conditions field listens to three external messages:

  • Set Form: Sets the checkbox from the message value: true accepts it and false clears it. The field is then validated and the Mock and own values are updated.
  • Clear Form: Clears the acceptance, validates, and updates the Mock and own values.
  • Reset Form: Restores the field to its unaccepted state, validates, and updates the Mock and own values.

Value from Datasource

The terms text and checkbox label come only from the editor settings; the field does not pull options from an external datasource. The only datasource interaction is on load, when a stored boolean of true from the form output pre-accepts the checkbox.