Skip to content

Commit

Permalink
bug #5565 [BUGFIX] Do not execute browser-side-validation, if novalid…
Browse files Browse the repository at this point in the history
…ate is set (mkrauser)

This PR was merged into the 4.x branch.

Discussion
----------

[BUGFIX] Do not execute browser-side-validation, if novalidate is set

This PR fixes the small issue #5564

I'm not sure if the early-return is ok. If not, I can of course put the logic inside the condition.

P.S.: Thanks for all your work on this nice bundle!

Commits
-------

6c2ed92 do not execute browser-side-validation, if novalidate is set
  • Loading branch information
javiereguiluz committed Jan 28, 2023
2 parents df74352 + 6c2ed92 commit 5540059
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class Form {
document.querySelectorAll('.form-tabs .nav-item .badge-danger.badge').forEach( (badge) => {
badge.parentElement.removeChild(badge);
});

if(null !== form.getAttribute('novalidate')) {
return;
}

form.querySelectorAll('input,select,textarea').forEach( (input) => {
if (!input.disabled && !input.validity.valid) {
Expand Down

0 comments on commit 5540059

Please sign in to comment.