From a451449766d581978068a5b8f8c1e27f50386ea7 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 23 Sep 2021 08:33:36 +0000 Subject: Revert "composer update bootstrap to version 5.1.1" This reverts commit 89e4006b2d84d398e34d407a019854823b1dd37d. --- .../docs/5.0/examples/checkout/form-validation.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vendor/twbs/bootstrap/site/content/docs/5.0/examples/checkout/form-validation.js (limited to 'vendor/twbs/bootstrap/site/content/docs/5.0/examples/checkout/form-validation.js') diff --git a/vendor/twbs/bootstrap/site/content/docs/5.0/examples/checkout/form-validation.js b/vendor/twbs/bootstrap/site/content/docs/5.0/examples/checkout/form-validation.js new file mode 100644 index 000000000..f8fd583de --- /dev/null +++ b/vendor/twbs/bootstrap/site/content/docs/5.0/examples/checkout/form-validation.js @@ -0,0 +1,20 @@ +// Example starter JavaScript for disabling form submissions if there are invalid fields +(function () { + 'use strict' + + // Fetch all the forms we want to apply custom Bootstrap validation styles to + var forms = document.querySelectorAll('.needs-validation') + + // Loop over them and prevent submission + Array.prototype.slice.call(forms) + .forEach(function (form) { + form.addEventListener('submit', function (event) { + if (!form.checkValidity()) { + event.preventDefault() + event.stopPropagation() + } + + form.classList.add('was-validated') + }, false) + }) +})() -- cgit v1.2.3