From 488a4e51954a068c9ba5c3fe767db9b288326ed2 Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Wed, 3 Mar 2021 17:09:42 -0500 Subject: [PATCH] improve non-live form validation styling behavior --- assets/js/_form-validity.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/assets/js/_form-validity.js b/assets/js/_form-validity.js index d897996..68dcb39 100644 --- a/assets/js/_form-validity.js +++ b/assets/js/_form-validity.js @@ -9,9 +9,8 @@ Array.prototype.slice.call(forms).forEach(function (form) { if (!form.checkValidity()) { event.preventDefault(); event.stopPropagation(); + form.classList.add("was-validated"); } - - form.classList.add("was-validated"); }, false );