{"record":{"id":"78a56748feea7694","repo":"octobercms/october","slug":"trigger-action-is-not-specified","errorCode":null,"errorMessage":"Trigger action is not specified.","messagePattern":"Trigger action is not specified\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"modules/system/assets/toolbox/controls/input-trigger/input-trigger-control.js","lineNumber":21,"sourceCode":" */\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' ||\n            this.triggerCondition == 'value';\n    }\n\n    connect() {","sourceCodeStart":3,"sourceCodeEnd":39,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/assets/toolbox/controls/input-trigger/input-trigger-control.js#L3-L39","documentation":"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).","triggerScenarios":"<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.","commonSituations":"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.","solutions":["Add data-trigger-action with a valid action: show, hide, enable, disable, or empty.","Combine multiple outcomes with a pipe: data-trigger-action=\"show|enable\".","Re-check all three trigger attributes are present (condition, trigger, action) — each has its own missing-attribute error."],"exampleFix":"<!-- before -->\n<div data-control=\"input-trigger\" data-trigger=\"[name=is_company]\" data-trigger-condition=\"checked\">...</div>\n\n<!-- after -->\n<div data-control=\"input-trigger\" data-trigger=\"[name=is_company]\" data-trigger-condition=\"checked\" data-trigger-action=\"show|enable\">...</div>","handlingStrategy":"validation","validationCode":"var TRIGGER_ACTIONS = ['show', 'hide', 'enable', 'disable', 'empty'];\nfunction triggerActionValid(el) {\n    var raw = el.getAttribute('data-trigger-action');\n    if (!raw) return false;\n    return raw.split('|').every(function (a) { return TRIGGER_ACTIONS.indexOf(a.trim()) !== -1; });\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use only show|hide|enable|disable|empty, joined with a pipe for combinations.","Include data-trigger-action in the same template helper as the other two trigger attributes.","Validate the action list in form-builder YAML before rendering markup."],"tags":["frontend","toolbox-controls","input-trigger","missing-attribute","form-ux"],"backgroundTag":"missing-required-attribute","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}