
FetchIt
Lightweight AJAX form submission in MODX via the Fetch API on top of FormIt or a custom snippet


Notiflix is a plain JS UI toolkit. For toasts, use the Notify module.
Script and FetchIt.Message via ESM:
<script type="module">
import Notiflix from 'https://cdn.jsdelivr.net/npm/notiflix@3/+esm'
document.addEventListener('DOMContentLoaded', () => {
FetchIt.Message = {
success(message) {
Notiflix.Notify.success(message)
},
error(message) {
Notiflix.Notify.failure(message)
},
}
})
</script>In a separate module with defer (after the FetchIt script), skip the DOMContentLoaded wrapper:
import Notiflix from 'https://cdn.jsdelivr.net/npm/notiflix@3/+esm'
FetchIt.Message = {
success(message) {
Notiflix.Notify.success(message)
},
error(message) {
Notiflix.Notify.failure(message)
},
}Form blocks [data-success] and [data-validation-error] work alongside toasts. Skip Message if you only need those blocks. Selectors: documentation.