How to add a contact form to a static site
A static site cannot receive a POST request on its own. Here is the shortest working path: one action attribute, one redirect, one honeypot field.
5 articles in this category. Browse everything.
A static site cannot receive a POST request on its own. Here is the shortest working path: one action attribute, one redirect, one honeypot field.
Duplicates come from three places: a double click, a retried request after a timeout, and a refreshed thank-you page. Each needs a different fix.
Native form submission is faster, works without JavaScript, and is easier to make accessible. fetch() gives you inline validation and no page reload. Here is how to decide.
Three working patterns for Next.js App Router forms: a server action, a client fetch, and a plain HTML form. Plus where the data should live.
A complete React form with controlled inputs, client validation, a real POST request and accessible error handling — no form library required.