lavkach3
1// Example starter JavaScript for disabling form submissions if there are invalid fields
2(function () {3"use strict";4window.addEventListener(5"load",6function () {7// Fetch all the forms we want to apply custom Bootstrap validation styles to8var forms = document.getElementsByClassName("needs-validation");9// Loop over them and prevent submission10var validation = Array.prototype.filter.call(forms, function (form) {11form.addEventListener(12"submit",13function (event) {14if (form.checkValidity() === false) {15event.preventDefault();16event.stopPropagation();17}18form.classList.add("was-validated");19},20false21);22});23},24false25);26})();27