octobercms/october · error · Error

Trigger condition is not specified.

Error message

Trigger condition is not specified.

What it means

InputTriggerControl (the 'input-trigger' toolbox control) implements the trigger API: show/hide/enable/disable/empty an element based on another input's state. init() requires three data attributes — data-trigger-condition, data-trigger, data-trigger-action — and this one fires when triggerCondition is absent (config defaults to false). Valid conditions are 'checked', 'unchecked', or 'value[expectedValue]' (wildcards allowed inside the brackets).

Source

Thrown at modules/system/assets/toolbox/controls/input-trigger/input-trigger-control.js:13

/*
 * The trigger API
 */
import { ControlBase, Events } from 'larajax';

const $ = window.jQuery;

var windowResizeTimer;

export default class InputTriggerControl extends ControlBase {
    init() {
        if (this.config.triggerCondition === false) {
            throw new Error('Trigger condition is not specified.');
        }

        if (this.config.trigger === false) {
            throw new Error('Trigger selector is not specified.');
        }

        if (this.config.triggerAction === false) {
            throw new Error('Trigger action is not specified.');
        }

        this.triggerSelector = this.config.trigger;
        this.triggerAction = this.config.triggerAction;
        this.triggerCondition = this.config.triggerCondition;

        if (this.config.triggerCondition.indexOf('value') == 0) {
            var match = this.config.triggerCondition.match(/\[([^\]]*)\]/g);
            this.triggerCondition = 'value';
            this.triggerConditionValue = match ? match.map(m => m.slice(1, -1)) : [""];

View on GitHub (pinned to b608633a7e)

Solutions

  1. Add data-trigger-condition with a valid value: 'checked', 'unchecked', or 'value[something]' (e.g. data-trigger-condition="value[standard]", wildcard value[*] allowed).
  2. Verify all three required attributes are present on the same element (condition, trigger, action) — the other two throw sibling errors.
  3. If the dependency behavior is not wanted, remove data-control="input-trigger" from the element.

Example fix

<!-- before -->
<div data-control="input-trigger" data-trigger="[name=is_company]" data-trigger-action="show">...</div>

<!-- after -->
<div data-control="input-trigger" data-trigger="[name=is_company]" data-trigger-condition="checked" data-trigger-action="show">...</div>
Defensive patterns

Strategy: validation

Validate before calling

// Validate the trigger triple before the control initializes
function triggerAttrsComplete(el) {
    return ['data-trigger-condition', 'data-trigger', 'data-trigger-action']
        .every(function (name) { return el.hasAttribute(name); });
}

Prevention

When it happens

Trigger: Markup like <div data-control="input-trigger" data-trigger="[name=type]" data-trigger-action="show"> — the condition attribute is missing; partial templates that conditionally emit some of the three attributes; typos in the attribute name (data-trigger-conditions) leaving config.triggerCondition false.

Common situations: Building dependent form fields in CMS partials; copying an example from docs but trimming the condition attribute; dynamic form generation (form builder YAML → markup) where the condition mapping was not supplied.

Related errors


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/7ed75da6934b79b2. Report an issue: GitHub.