From e6dac085cb1d601da1fc63bfd59d811612fa6ef4 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 8 Oct 2021 12:24:19 +0000 Subject: update composer libs --- .../docs/5.1/examples/checkout/form-validation.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 vendor/twbs/bootstrap/site/content/docs/5.1/examples/checkout/form-validation.js (limited to 'vendor/twbs/bootstrap/site/content/docs/5.1/examples/checkout/form-validation.js') diff --git a/vendor/twbs/bootstrap/site/content/docs/5.1/examples/checkout/form-validation.js b/vendor/twbs/bootstrap/site/content/docs/5.1/examples/checkout/form-validation.js new file mode 100644 index 000000000..f8fd583de --- /dev/null +++ b/vendor/twbs/bootstrap/site/content/docs/5.1/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