Svelte contact form
Paste this into Svelte. Posts go to Formgong. No database and no Resend.
AI lead scoring is free on every plan, up to 100 scored submissions a month. Turn it on for the form. Hot leads and likely spam show in Telegram, email, and the inbox.
<script>
let status = $state("");
async function onSubmit(event) {
event.preventDefault();
const fields = Object.fromEntries(new FormData(event.currentTarget));
const response = await fetch("https://formgong.com/submit", {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify({ ...fields, access_key: "fk_your_access_key" }),
});
const result = await response.json();
status = result.success ? "ok" : (result.message || "error");
}
</script>
<form onsubmit={onSubmit}>
<input name="name" required>
<input name="email" type="email" required>
<textarea name="message" required></textarea>
<div aria-hidden="true" style="position:absolute;left:-10000px">
<input name="botcheck" tabindex="-1" autocomplete="off">
</div>
<button type="submit">Send</button>
<p>{status}</p>
</form>