Fix search form validation

This commit is contained in:
2026-01-15 15:17:20 +01:00
parent d1e741ebfd
commit 8c216c7e56
5 changed files with 23 additions and 21 deletions

View File

@@ -10,21 +10,3 @@
<button class="btn btn-outline-primary" type="submit">Search</button>
</div>
</form>
<script>
(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()) {
form.classList.add('was-validated')
event.preventDefault()
event.stopPropagation()
}
}, false)
})
})()
</script>