diff --git a/views/reset.pug b/views/reset.pug index 3a9173411b869fe3e4e4fc807bd00f58000e6a6b..b245b94978b8d0888d0b88e480a28968c5620437 100644 --- a/views/reset.pug +++ b/views/reset.pug @@ -56,6 +56,22 @@ html(lang="en") // Bootstrap script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") // M4_LAB - script(src="/account/js/account.js") script(src="/account/js/generalFunction.js") - script(src="/js/headfoot.js") \ No newline at end of file + script(src="/js/headfoot.js") + script. + // check input fields + 'use strict'; + window.addEventListener('load', function() { + // Fetch all the forms we want to apply custom Bootstrap validation styles to + var forms = document.getElementsByClassName('needs-validation'); + // Loop over them and prevent submission + var validation = Array.prototype.filter.call(forms, function(form) { + form.addEventListener('submit', function(event) { + if (form.checkValidity() === false) { + event.preventDefault(); + event.stopPropagation(); + } + form.classList.add('was-validated'); + }, false); + }); + }, false); diff --git a/views/security.pug b/views/security.pug index 9908aa1a49a3a42cb756ba1b40ad0b3235687937..37c990e9cec8fbc4e201cfa66003c5856d8786ed 100644 --- a/views/security.pug +++ b/views/security.pug @@ -72,7 +72,7 @@ html(lang="en") // Bootstrap script(src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous") // M4_LAB - script(src="/account/js/account.js") + script(src="/account/js/security.js") script(src="/account/js/generalFunction.js") script(src="/js/headfoot.js") script.