From eaf5ed7cef147386895bdfd52e841ec9d6a95200 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Wed, 11 Dec 2019 11:48:38 +0100 Subject: [PATCH] copied script from security.pug to reset.pug to reenable reset --- views/reset.pug | 20 ++++++++++++++++++-- views/security.pug | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/views/reset.pug b/views/reset.pug index 3a917341..b245b949 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 9908aa1a..37c990e9 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. -- GitLab