octobercms/october · error · Error

Trigger action is not specified.

Error message

Trigger action is not specified.

What it means

The third required attribute of InputTriggerControl: data-trigger-action defines what happens to the element when the condition matches, and its absence (config.triggerAction === false) throws this error in init(). Valid actions are 'show', 'hide', 'enable', 'disable' and 'empty', combinable with a pipe, e.g. "show|enable" (updateTarget splits on '|' and applies each).

Source

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

 */
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)) : [""];
        }

        this.conditionValid = this.triggerCondition == 'checked' ||
            this.triggerCondition == 'unchecked' ||
            this.triggerCondition == 'value';
    }

    connect() {

View on GitHub (pinned to b608633a7e)

Solutions

  1. Add data-trigger-action with a valid action: show, hide, enable, disable, or empty.
  2. Combine multiple outcomes with a pipe: data-trigger-action="show|enable".
  3. Re-check all three trigger attributes are present (condition, trigger, action) — each has its own missing-attribute error.

Example fix

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

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

Strategy: validation

Validate before calling

var TRIGGER_ACTIONS = ['show', 'hide', 'enable', 'disable', 'empty'];
function triggerActionValid(el) {
    var raw = el.getAttribute('data-trigger-action');
    if (!raw) return false;
    return raw.split('|').every(function (a) { return TRIGGER_ACTIONS.indexOf(a.trim()) !== -1; });
}

Prevention

When it happens

Trigger: <div data-control="input-trigger" data-trigger="[name=x]" data-trigger-condition="checked"> with no data-trigger-action; supplying a list with a comma instead of a pipe; markup copied from docs examples that omit the action.

Common situations: Authoring dependent-field markup and forgetting the outcome attribute; combining multiple outcomes with the wrong separator (comma) so only parsing of the first happens at runtime even though the attribute exists — but full absence is what throws here.

Related errors


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