diff --git a/src/pages/Signup.jsx b/src/pages/Signup.jsx index 6260c1d..2832bd8 100644 --- a/src/pages/Signup.jsx +++ b/src/pages/Signup.jsx @@ -47,10 +47,27 @@ export default function SignUp() { }); } + (() => { + // Fetch all the forms we want to apply custom Bootstrap validation styles to + const forms = document.querySelectorAll('.needs-validation') + + // Loop over them and prevent submission + Array.from(forms).forEach(form => { + form.addEventListener('submit', event => { + if (!form.checkValidity()) { + event.preventDefault(); + event.stopPropagation(); + } + + form.classList.add('was-validated') + }, false) + }) + })() + return (