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
- Add data-trigger with the watched field's selector, e.g. data-trigger="[name=type]" or data-trigger="#country, [name=state]".
- Keep it on the same element as the other two trigger attributes.
- 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
- Remember data-trigger takes a CSS selector ([name=x], #id), not a bare field name.
- Verify the selector matches an existing input after markup changes/refactors.
- Generate all three trigger attributes from a single template component.
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
- Trigger condition is not specified.
- Trigger action is not specified.
- No hotkey has been defined.
- command option is not set for toolbar button
- command option is not set for menu item
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/4dbb7fb1c4f20b48.
Report an issue: GitHub.