
FetchIt
Lightweight component for form handling and submission using Fetch API


This section covers examples with Micromodal.js modals.
If your form is inside a modal and you want to close it after a successful submit, use the fetchit:success event.
document.addEventListener('fetchit:success', ({ detail }) => {
const { form } = detail;
// Determine the modal ID relative to the form
MicroModal.close('modal-id');
});