Why my form doesn't submit — 3 causes and how to check each one

You hit “Submit.” The page blinks, the fields clear, no error appears. And no email arrives.
Here's what's usually happening: the form isn't broken — it submitted. Into nowhere. The browser did exactly what it does with forms by default, and your code never took part.
Let's go through three causes, most common first. Each takes a minute to check.
If you have no time to read, here's the order: look at the address bar after the click → open the Network tab and confirm a request left at all → log the contents of FormData → and only then go looking at the server. Three breakages out of four are caught in the first two steps.
Cause 1: the browser handled the form itself
The <form> tag has default behaviour built into browsers since the nineties: collect the fields, navigate to the action URL and reload the page. With no action, it reloads the current page and appends the data to the address.
That's exactly why it feels like “nothing happened”: the page simply repainted from scratch.
How to check. Hit submit and look at the address bar. If you see ?name=Anna&email=..., diagnosis confirmed: your data went into the URL, not to a server.
Second method: open DevTools → Network tab and tick Preserve log. If a document navigation shows up after the click instead of your request, the default behaviour is running the show.
How to fix. Cancel it on the first line of your handler:
function handleSubmit(e) {
e.preventDefault(); // without this line the page reloads
// your submit logic here
}
<form onSubmit={handleSubmit}>
A neighbouring classic: preventDefault is there, but the handler is attached to the button instead of the form. Then pressing Enter in a field bypasses it entirely. Put onSubmit on the <form> and both the click and Enter work.
Cause 2: the fields have no name attribute
This is the signature bug of generated forms. The fields look great: placeholder, id, classes — all present. name is missing.
The catch is that the browser collects form data by name. No attribute, no inclusion. The form goes out empty, the server replies “please fill in the required fields”, and you stare at your perfectly filled-in fields in disbelief.
How to check. Add one line to your handler:
console.log([...new FormData(e.target)]);
An empty array — or one missing some of your fields — is your answer.
How to fix. Give a name to every field that should travel:
<input type="email" name="email" placeholder="Email" />
id links a field to its <label>; name carries the data. Different jobs, and one doesn't substitute for the other. How these element links work has its own breakdown.
Cause 3: the button doesn't submit
A button inside a form counts as a submit button by default. But it's easy to disable that, often by accident.
<button type="button">submits nothing. It gets typed out of habit or copied from an example.- The button sits outside the
<form>— visually adjacent, structurally unrelated. - Built-in validation kicks in: a
requiredfield is empty, so the browser silently blocks the submit. If that field is hidden by CSS, you never even see the “please fill this in” tooltip.
How to check. Temporarily drop every required and set the button to type="submit". If it goes through, you found it — now add the validation back one rule at a time.
If the request goes out and still nothing happens
Then it's no longer the form's fault — it's what happens next. Open the Network tab; the request and the response are both there.
- 404 — wrong handler URL. A typo, or the route was never created.
- 405 (Method Not Allowed) — the URL exists but doesn't accept POST. Classic case: the handler only implements GET.
- A CORS error — the form is on one domain, the handler on another, and that server didn't allow the request. It's fixed server-side; breakdown here.
- The request goes out but your code doesn't continue — a forgotten
awaitonfetch. Its own classic: why fetch returns undefined.
The debugging order is always the same: first confirm the request left at all, then work out why the server disliked it.
Why does the form work locally but not on the live site?
Usually the handler URL. Locally you post to localhost:3000, which doesn't exist in production — you need a relative path (/api/contact) or an address from environment variables. The second most common cause is CORS: the domains matched locally and diverged in production.
Do I need a server for a form to work?
Someone has to receive the data, but you don't have to write that yourself. Form-endpoint services and no-code options exist — the full path to a working form is covered in the contact form guide.
The AI Architect 2027 course: step by step from computer basics to your own app and first customers. 543 short lessons on your phone.





