TEMPLATE #09
Newsletter & Waitlist Signup Form
A single email field. The Alpine.js version submits without reloading the page.
HTML Alpine.js
1 field · No page reload
Live preview
Sandboxed<form action="https://app.submityourform.com/f" method="POST">
<!-- Your form key from the SubmitYourForm dashboard. It is public: it only lets people send to this form. -->
<input type="hidden" name="_form_key" value="YOUR-FORM-KEY" />
<!-- Honeypot: hidden from people. Submissions that fill it are filed as spam. -->
<input type="text" name="_honeypot" tabindex="-1" autocomplete="off" style="display:none" aria-hidden="true" />
<div>
<label for="f-email">Email address</label>
<input id="f-email" type="email" name="email" required />
</div>
<button type="submit">Submit</button>
</form>
<form x-data="{ status: 'idle', error: '' }"
@submit.prevent="
status = 'sending'; error = '';
fetch('https://app.submityourform.com/f', { method: 'POST', body: new FormData($el), headers: { Accept: 'application/json' } })
.then(r => r.json().catch(() => ({})).then(j => {
if (r.ok && j.ok !== false) { status = 'sent'; $el.reset(); }
else { error = [(j.error && j.error.message) || 'Something went wrong. Please try again.'].concat(((j.error && j.error.fields) || []).map(f => f.message)).join(' '); status = 'error'; }
}))
.catch(() => { error = 'Could not reach the server. Please try again.'; status = 'error'; })">
<input type="hidden" name="_form_key" value="YOUR-FORM-KEY" />
<input type="text" name="_honeypot" tabindex="-1" autocomplete="off" style="display:none" aria-hidden="true" />
<label for="f-email">Email address</label>
<input id="f-email" type="email" name="email" required />
<button type="submit" :disabled="status === 'sending'">Subscribe</button>
<p x-show="status === 'sent'" role="status">You're subscribed.</p>
<p x-show="status === 'error'" role="alert" x-text="error"></p>
</form>
Replace YOUR-FORM-KEY with the form key from your form's Setup page (in the app, forms are called Endpoints). The form key is public; never put your REST API key (syf_live_…) in browser code.