Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. <!-- Validation Script-->
  2. <script>
  3. // Self-executing function
  4. (function () {
  5. 'use strict';
  6. window.addEventListener('load', function () {
  7. // Fetch all the forms we want to apply custom Bootstrap validation styles to
  8. var forms = document.getElementsByClassName('needs-validation');
  9. // Loop over them and prevent submission
  10. var validation = Array.prototype.filter.call(forms, function (form) {
  11. form.addEventListener('submit', function (event) {
  12. if (form.checkValidity() === false) {
  13. event.preventDefault();
  14. event.stopPropagation();
  15. }
  16. form.classList.add('was-validated');
  17. }, false);
  18. });
  19. }, false);
  20. })();
  21. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement