diff options
Diffstat (limited to 'site/content/docs/5.2/examples/checkout/form-validation.js')
-rw-r--r-- | site/content/docs/5.2/examples/checkout/form-validation.js | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/site/content/docs/5.2/examples/checkout/form-validation.js b/site/content/docs/5.2/examples/checkout/form-validation.js deleted file mode 100644 index 30ea0aa..0000000 --- a/site/content/docs/5.2/examples/checkout/form-validation.js +++ /dev/null @@ -1,19 +0,0 @@ -// 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) - }) -})() |