CJVT updates August and September 2026
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
/* global axios, bootstrap */
|
||||
|
||||
const contactAuthorsForm = document.querySelector('#contact-authors-form')
|
||||
|
||||
if (contactAuthorsForm) {
|
||||
contactAuthorsForm.addEventListener('submit', async event => {
|
||||
event.preventDefault()
|
||||
if (!contactAuthorsForm.checkValidity()) {
|
||||
event.stopPropagation()
|
||||
contactAuthorsForm.classList.add('was-validated')
|
||||
return
|
||||
}
|
||||
|
||||
const payload = Object.fromEntries(new FormData(event.target))
|
||||
const res = await axios.post(event.target.action, payload)
|
||||
|
||||
if (res.status === 201) {
|
||||
contactAuthorsForm.reset()
|
||||
contactAuthorsForm.classList.remove('was-validated')
|
||||
|
||||
const infoModal = document.getElementById('contact-authors-response')
|
||||
if (infoModal) {
|
||||
const responseModal = new bootstrap.Modal(infoModal)
|
||||
responseModal.toggle()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user