{"record":{"id":"4dbb7fb1c4f20b48","repo":"octobercms/october","slug":"trigger-selector-is-not-specified","errorCode":null,"errorMessage":"Trigger selector is not specified.","messagePattern":"Trigger selector is not specified\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/system/assets/toolbox/controls/input-trigger/input-trigger-control.js","lineNumber":17,"sourceCode":"/*\n * The trigger API\n */\nimport { ControlBase, Events } from 'larajax';\n\nconst $ = window.jQuery;\n\nvar windowResizeTimer;\n\nexport default class InputTriggerControl extends ControlBase {\n    init() {\n        if (this.config.triggerCondition === false) {\n            throw new Error('Trigger condition is not specified.');\n        }\n\n        if (this.config.trigger === false) {\n            throw new Error('Trigger selector is not specified.');\n        }\n\n        if (this.config.triggerAction === false) {\n            throw new Error('Trigger action is not specified.');\n        }\n\n        this.triggerSelector = this.config.trigger;\n        this.triggerAction = this.config.triggerAction;\n        this.triggerCondition = this.config.triggerCondition;\n\n        if (this.config.triggerCondition.indexOf('value') == 0) {\n            var match = this.config.triggerCondition.match(/\\[([^\\]]*)\\]/g);\n            this.triggerCondition = 'value';\n            this.triggerConditionValue = match ? match.map(m => m.slice(1, -1)) : [\"\"];\n        }\n\n        this.conditionValid = this.triggerCondition == 'checked' ||\n            this.triggerCondition == 'unchecked' ||","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/assets/toolbox/controls/input-trigger/input-trigger-control.js#L1-L35","documentation":"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.","triggerScenarios":"<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.","commonSituations":"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.","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."],"exampleFix":"<!-- before -->\n<div data-control=\"input-trigger\" data-trigger-condition=\"value[standard]\" data-trigger-action=\"show\">...</div>\n\n<!-- after -->\n<div data-control=\"input-trigger\" data-trigger=\"[name=account_type]\" data-trigger-condition=\"value[standard]\" data-trigger-action=\"show\">...</div>","handlingStrategy":"validation","validationCode":"// Ensure the watched-field selector attribute exists\nfunction triggerSelectorPresent(el) {\n    var selector = el.getAttribute('data-trigger');\n    if (!selector) return false;\n    try { document.querySelector(selector); } catch (e) { return false; } // also rejects invalid selectors\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["frontend","toolbox-controls","input-trigger","missing-attribute","css-selector"],"backgroundTag":"missing-required-attribute","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}