source: resources/assets/js/examples/form-validator.js@ 582789f

develop
Last change on this file since 582789f was 7304c7f, checked in by beratkjufliju <kufliju@…>, 3 years ago

added user authentication, create & forgot password methods and blades

  • Property mode set to 100644
File size: 701 bytes
Line 
1(function () {
2 'use strict';
3 window.addEventListener('load', function () {
4 // Fetch all the forms we want to apply custom Bootstrap validation styles to
5 var forms = document.getElementsByClassName('needs-validation');
6 // Loop over them and prevent submission
7 var validation = Array.prototype.filter.call(forms, function (form) {
8 form.addEventListener('submit', function (event) {
9 if (form.checkValidity() === false) {
10 event.preventDefault();
11 event.stopPropagation();
12 }
13 form.classList.add('was-validated');
14 }, false);
15 });
16 }, false);
17})();
Note: See TracBrowser for help on using the repository browser.