Form action defined.
The action attribute of an HTML <form> tag holds the URL the browser sends the submission to. When the visitor hits submit, the form's field data goes to that address.
How the form action attribute works
The action attribute is the form's forwarding address. It works as a pair with method: action says where the submission goes, method says how. GET appends the fields to the URL as a query string, POST carries them in the request body. A form that sends data somewhere should use POST, so the fields travel in the body rather than ending up in URLs, logs and browser history.
Action accepts any URL. If you leave it out, the browser submits to the current page's own URL, which only works when a server at that address is expecting form data. On a static site there isn't one, so the page just reloads and the submission evaporates. That's why static-site forms point action at a form backend: the tag becomes action="https://api.formwire.com/submit" method="POST", a hidden access key identifies your account, and the service on the other end takes the submission from there.
What the attribute pair controls.
action, the address
The URL that receives the submission. For a static site, this is the single line that connects your HTML to a working backend.
method, the verb
GET puts fields in the URL, POST puts them in the request body. Submissions that create or send data belong in a POST.
name, the payload
Only inputs with a name attribute are submitted. Each name becomes a key in the data the endpoint receives.
Related questions
The browser submits the form to the page's own URL. On a site with a server-side handler that can be intentional; on a static site it means a reload that throws the data away. An explicit action pointing at a real endpoint is the fix.
What a form backend does →POST, for anything that sends real data. GET encodes every field into the URL, where it's visible, cached, logged and length-limited. POST keeps the fields in the request body, supports file uploads via multipart encoding, and is what form endpoints expect.
How the form enctype sets the encoding →Yes, fetch can POST the same fields to the same URL and read the JSON response, which is how single-page apps usually submit. The action attribute and a fetch call are two routes to the identical endpoint; the plain HTML route just works with zero script.
One URL and one hidden field: point action at https://api.formwire.com/submit with method POST, and include your access key as a hidden input. Every named field in the form arrives in the email and the stored record.
The quickstart shows the exact form tag →Want to see it working?
Read the docsGive your form an action worth pointing at.
Free tier forever. No credit card required.