octobercms/october · error · Error

The tab controls element should have the id attribute value.

Error message

The tab controls element should have the id attribute value.

What it means

TabFormExpandControls.init derives a unique tabsControlId from the tabs control element's id attribute; when the element has no id the control cannot register/resolve itself and initialization aborts with this error. The markup of the tab control element is at fault.

Solutions

  1. Add a unique id attribute to the element with data-control="tabformexpandcontrols"
  2. Ensure IDs are unique per page when multiple tab controls exist
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/assets/js/october/october.tabformexpandcontrols.js:27 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at modules/backend/assets/js/october/october.tabformexpandcontrols.js:27

        BaseProto = Base.prototype

    var TabFormExpandControls = function ($tabsControlElement, options) {
        this.$tabsControlElement = $tabsControlElement
        this.options = $.extend(TabFormExpandControls.DEFAULTS, typeof options == 'object' && options)
        this.tabsControlId = null

        Base.call(this)
        this.init()
    }

    TabFormExpandControls.prototype = Object.create(BaseProto)
    TabFormExpandControls.prototype.constructor = TabFormExpandControls

    TabFormExpandControls.prototype.init = function() {
        this.tabsControlId = this.$tabsControlElement.attr('id')

        if (!this.tabsControlId) {
            throw new Error('The tab controls element should have the id attribute value.')
        }

        this.registerHandlers()
    }

    TabFormExpandControls.prototype.dispose = function() {
        this.unregisterHandlers()

        this.$tabsControlElement = null

        BaseProto.dispose.call(this)
    }

    TabFormExpandControls.prototype.registerHandlers = function() {
        this.$tabsControlElement.on('initTab.oc.tab', this.proxy(this.initTab))
        this.$tabsControlElement.on('click', '[data-control="tabless-collapse-icon"]', this.proxy(this.tablessCollapseClicked))
        this.$tabsControlElement.on('click', '[data-control="primary-collapse-icon"]', this.proxy(this.primaryCollapseClicked))
    }

View on GitHub (pinned to b608633a7e)