Adding upstream version 5.2.3+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
b80f12a01d
commit
bc475d7d0d
617 changed files with 89471 additions and 0 deletions
19
site/static/docs/5.2/assets/js/validate-forms.js
Normal file
19
site/static/docs/5.2/assets/js/validate-forms.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
// 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)
|
||||
})
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue