Keep your site on Netlify, or move it, without tying the contact form to one host.
Netlify Forms are convenient if the whole site stays on Netlify. If you might move hosts, or you already build elsewhere, a host-agnostic form backend is simpler.
Replace the Netlify-specific attributes with a Formcask action. You do not need data-netlify="true" or a hidden form in the build:
<form action="https://formcask.com/f/f_YOUR_FORM_ID" method="POST">
<label>Name <input type="text" name="name" required></label>
<label>Email <input type="email" name="email" required></label>
<label>Message <textarea name="message" required></textarea></label>
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>
Deploy the site as usual. Formcask stores the submissions and emails you, even if the site later moves to Cloudflare Pages, Vercel, GitHub Pages, S3, or a VPS.
For AJAX (the fetch pattern many Netlify examples use), POST JSON to the same URL with Accept: application/json. You will get {"ok":true} instead of a redirect.
const res = await fetch("https://formcask.com/f/f_YOUR_FORM_ID", {
method: "POST",
headers: { "content-type": "application/json", accept: "application/json" },
body: JSON.stringify({ name, email, message }),
});
const data = await res.json(); // { ok: true } on success
Related: Vercel · Eleventy · Plain HTML