When a powermail multi-step form contains a mandatory checkbox group (multiple checkboxes sharing name="…[]") that is conditionally hidden/shown by EXT:powermail_cond, submitting the form after checking a non-first checkbox of that group produces a browser console error:
An invalid form control with name='tx_powermail_pi1[field][<marker>][]' is not focusable.
and blocks form submission.
Root cause:
Two bugs in PowermailConditions.js:
#getFieldByMarker returns only the first checkbox. It uses querySelector (singular), so #hideField/#showField only disable/enable and derequire/rerequire the first checkbox of a multi-value group. The remaining checkboxes keep their validation state unchanged.
#rerequireField converts data-powermail-required to native required. Powermail renders multi-checkbox mandatory fields with data-powermail-required="true" (not native required) and handles "at least one checked" via data-powermail-multiple. The old #rerequireField unconditionally restored a native required attribute, which the browser's reportValidity() (called by #submitListener) then tried to enforce. In a multi-step form the field's fieldset is display:none (hidden by the morestep navigation), so the browser cannot focus the invalid checkbox and emits the "not focusable" error.
Trigger conditions (all required):
- Multi-step form (
moresteps=1) with 2+ pages
- Mandatory checkbox group on a non-final step, conditionally hidden by powermail_cond
- Powermail JS validation active (
data-powermail-validate)
- User checks a non-first checkbox of the shown group, then navigates to the next step and submits
Fix:
#hideField/#showField: iterate querySelectorAll('input, select, textarea') over the wrapping container so all inputs in a multi-value group are disabled/enabled and derequired/rerequired.
#derequireField/#rerequireField: bookmark which attribute was present (required or data-powermail-required) and restore the same one, preserving powermail's custom validation mechanism for multi-checkbox groups.
TYPO3: 13
Powermail: 13.1.0
Powermail Cond: 13.1.2
When a powermail multi-step form contains a mandatory checkbox group (multiple checkboxes sharing name="…[]") that is conditionally hidden/shown by EXT:powermail_cond, submitting the form after checking a non-first checkbox of that group produces a browser console error:
and blocks form submission.
Root cause:
Two bugs in
PowermailConditions.js:#getFieldByMarkerreturns only the first checkbox. It usesquerySelector(singular), so#hideField/#showFieldonly disable/enable and derequire/rerequire the first checkbox of a multi-value group. The remaining checkboxes keep their validation state unchanged.#rerequireFieldconvertsdata-powermail-requiredto nativerequired. Powermail renders multi-checkbox mandatory fields withdata-powermail-required="true"(not native required) and handles "at least one checked" viadata-powermail-multiple. The old#rerequireFieldunconditionally restored a nativerequiredattribute, which the browser'sreportValidity()(called by#submitListener) then tried to enforce. In a multi-step form the field's fieldset isdisplay:none(hidden by the morestep navigation), so the browser cannot focus the invalid checkbox and emits the "not focusable" error.Trigger conditions (all required):
moresteps=1) with 2+ pagesdata-powermail-validate)Fix:
#hideField/#showField: iteratequerySelectorAll('input, select, textarea')over the wrapping container so all inputs in a multi-value group are disabled/enabled and derequired/rerequired.#derequireField/#rerequireField: bookmark which attribute was present (requiredordata-powermail-required) and restore the same one, preserving powermail's custom validation mechanism for multi-checkbox groups.TYPO3: 13
Powermail: 13.1.0
Powermail Cond: 13.1.2