Forms & Submissions
Handling Form Submissions
Capture and manage form submissions from your website.
Setting Up Forms
Add the data-form-name attribute to your HTML forms:
<form data-form-name="contact">
<input type="text" name="name" required>
<input type="email" name="email" required>
<textarea name="message"></textarea>
<button type="submit">Send</button>
</form>
Form Handler Script
Include this JavaScript to handle submissions:
document.querySelectorAll('form[data-form-name]').forEach(form => {
form.addEventListener('submit', async (e) => {
e.preventDefault();
const formData = new FormData(form);
const data = Object.fromEntries(formData);
await fetch('/_forms/' + form.dataset.formName, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
alert('Thank you!');
form.reset();
});
});
Viewing Submissions
- Go to Forms in the sidebar
- Select a form to view its submissions
- Click on a submission to see all fields
Email Notifications
- Go to Settings → Form Notifications
- Click Add Rule
- Enter email addresses to notify
- Optionally filter by form name
Exporting Submissions
Download submissions as CSV from the Forms section.