Sha256: dfdfc47b85e4fbd17c302f43a8c3b8cc2db41d6188b6ab45beda705e6d82ccc5
Contents?: true
Size: 616 Bytes
Versions: 26
Compression:
Stored size: 616 Bytes
Contents
// 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) }) })()
Version data entries
26 entries across 13 versions & 1 rubygems