applicant-site/resources/views/layouts/bootstrap_validation.blade.php

19 lines
548 B
PHP
Raw Permalink Normal View History

2024-03-06 17:11:35 +03:00
<script>
(function () {
'use strict'
var forms = document.querySelectorAll('.needs-validation')
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)
})
})()
</script>