19 lines
548 B
PHP
19 lines
548 B
PHP
<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>
|