diff options
author | Mario <mario@mariovavti.com> | 2022-10-10 18:05:26 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-10-10 18:05:26 +0000 |
commit | ef2448e17e742e7dcef458993bce1e0a29756aa7 (patch) | |
tree | d23c62753abbb42e7bb742f2d44d09321b6f2eee /vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js | |
parent | 6ab65519a0fc3e55ad5f32ce1641190ef609a4e2 (diff) | |
parent | 99a5cf1ad4660a31af6c03e5a1abc3d374f82c78 (diff) | |
download | volse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.tar.gz volse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.tar.bz2 volse-hubzilla-ef2448e17e742e7dcef458993bce1e0a29756aa7.zip |
Merge branch '7.8RC'7.8
Diffstat (limited to 'vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js')
-rw-r--r-- | vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js b/vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js new file mode 100644 index 000000000..30ea0aa6b --- /dev/null +++ b/vendor/twbs/bootstrap/site/content/docs/5.2/examples/checkout/form-validation.js @@ -0,0 +1,19 @@ +// Example starter JavaScript for disabling form submissions if there are invalid fields +(() => { + 'use strict' + + // Fetch all the forms we want to apply custom Bootstrap validation styles to + const forms = document.querySelectorAll('.needs-validation') + + // Loop over them and prevent submission + Array.from(forms).forEach(form => { + form.addEventListener('submit', event => { + if (!form.checkValidity()) { + event.preventDefault() + event.stopPropagation() + } + + form.classList.add('was-validated') + }, false) + }) +})() |