Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Resources/Public/JavaScript/PowermailCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,15 @@ class PowermailCondition {
* Note: reportValidity() alone is not sufficient because it always returns
* true when the form has a "novalidate" attribute (i.e. when native
* validation is disabled via TypoScript validation.native = 0).
*
* Native validation is skipped for required powermail checkbox groups because
* its behaviour does not match powermail's checkbox group validation.
*/
#hasValidationErrors() {
if (!this.#form.reportValidity()) {
return true;
if (!this.#hasRequiredCheckboxGroup()) {
if (!this.#form.reportValidity()) {
return true;
}
}
if (this.#form.classList.contains('powermail_form_error')) {
return true;
Expand Down Expand Up @@ -283,6 +288,10 @@ class PowermailCondition {
return this.#form.getAttribute('data-validate') === 'html5';
};

#hasRequiredCheckboxGroup() {
return this.#form.querySelector('input[type="checkbox"][required][data-powermail-multiple="checkbox"]') !== null;
};

#getWrappingContainerByMarkerName(fieldMarker) {
let wrappingContainer = this.#getFieldwrappingContainerByMarker(fieldMarker);
if (wrappingContainer !== null) {
Expand Down
Loading