Skip to content

Commit c7de577

Browse files
authored
[BUGFIX] Exclude reset-field from validation
**Test** 1. Form with at least one mandatory-fields, reset-field and submit-field 2. Click on submit **current behavior without fix** Form is submitted to server with an js-error in console ("Uncaught TypeError: e.getAttribute(...) is null") although there are validation errors. **current behavior with fix** Form is not submitted and js-errors are shown.
1 parent dd72729 commit c7de577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Resources/Private/Build/JavaScript/FormValidation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ class Form {
473473

474474
#getFieldsFromForm() {
475475
return this.#form.querySelectorAll(
476-
'input:not([data-powermail-validation="disabled"]):not([type="hidden"]):not([type="submit"])'
476+
'input:not([data-powermail-validation="disabled"]):not([type="hidden"]):not([type="reset"]):not([type="submit"])'
477477
+ ', textarea:not([data-powermail-validation="disabled"])'
478478
+ ', select:not([data-powermail-validation="disabled"])'
479479
);

0 commit comments

Comments
 (0)