octobercms/october · error · Error

Trigger selector is not specified.

Error message

Trigger selector is not specified.

What it means

Same InputTriggerControl init(): after the condition check, the control requires data-trigger — the CSS selector of the input(s) whose change events are watched (scoped optionally via data-trigger-closest-parent). config.trigger === false means the attribute is absent and this error is thrown. Note the selector is used as a delegated jQuery selector: $('change', this.triggerSelector, ...), so an invalid selector would fail differently — this error is strictly about absence.

Source

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

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

        this.conditionValid = this.triggerCondition == 'checked' ||
            this.triggerCondition == 'unchecked' ||

View on GitHub (pinned to b608633a7e)

Solutions

  1. Add data-trigger with the watched field's selector, e.g. data-trigger="[name=type]" or data-trigger="#country, [name=state]".
  2. Keep it on the same element as the other two trigger attributes.
  3. If scoping is needed inside repeated partials, also set data-trigger-closest-parent to the repeating container's selector.

Example fix

<!-- before -->
<div data-control="input-trigger" data-trigger-condition="value[standard]" data-trigger-action="show">...</div>

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

Strategy: validation

Validate before calling

// Ensure the watched-field selector attribute exists
function triggerSelectorPresent(el) {
    var selector = el.getAttribute('data-trigger');
    if (!selector) return false;
    try { document.querySelector(selector); } catch (e) { return false; } // also rejects invalid selectors
    return true;
}

Prevention

When it happens

Trigger: <div data-control="input-trigger" data-trigger-condition="checked" data-trigger-action="show"> with no data-trigger attribute; templates where the selector attribute was renamed or omitted; markup generators that output condition/action but not the selector.

Common situations: Hand-authoring trigger markup in partials; refactoring form field names without updating which attribute carries the selector; misunderstanding that data-trigger must be a selector like "[name=type]" or "#country" rather than a field name.

Related errors


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