Skip to content
Explainers

How to make an HTML form work on a static page

The page is live, someone presses Submit — and nothing happens, or a 405 error. Static hosting has no server to receive the form. Here is how to give it one for free.

6 min readUpdated October 2026By the HTMLtoURL.dev team
Short answer

Point the form's action at a form-backend service such as Formspree, Basin or Getform — they receive the submission and email it to you, free for low volumes. Alternatives: send it to a Google Sheet via an Apps Script web app, embed a Google Form, or use a mailto: link for the simplest cases.

Why the form does nothing

A form submission is an HTTP request to the address in action. On a static host there is no program at that address — only files — so the request fails (often 405 Method Not Allowed) or reloads the page. JavaScript in the page can collect the values, but it has nowhere to store them that you can see.

<form action="https://formspree.io/f/YOUR_ID" method="POST">
  <input name="email" type="email" required placeholder="Your email">
  <textarea name="message" required></textarea>
  <button>Send</button>
</form>

Sign up, create a form, paste its endpoint into action, and submissions arrive by email and in a dashboard. Most services include spam filtering and a free tier of around 50 submissions a month.

Option 2 — Straight into Google Sheets

Create a Sheet → Extensions → Apps Script, add a doPost(e) function that appends e.parameter values as a row, deploy it as a web app ("Anyone" can access) and use the web-app URL as the form action (or fetch() it with mode: "no-cors"). Free and you own the data; set-up takes ten minutes.

Option 3 — Embed a Google Form

Build the form in Google Forms and paste its Send → <> embed iframe into your page. Zero code, but it looks like Google Forms.

Option 4 — mailto: (simplest, least reliable)

<form action="mailto:you@example.com" method="post" enctype="text/plain"> opens the visitor's email app with the fields filled in. It only works if they have a mail app configured — fine for internal pages, poor for public ones.

Convert your HTML to a URL now
Paste code or drop a file, ZIP or folder. Free plan, custom address, password & editing included.
Get a URL

Quizzes and calculators do not need a backend

If the form only calculates or scores something on the page — a quiz, a price calculator, a BMI tool — prevent the submit and handle it in JavaScript (form.addEventListener('submit', e => { e.preventDefault(); … })). Everything stays in the browser and works perfectly on static hosting.

Questions people ask

Why do I get 405 Method Not Allowed when submitting my form?

The static host cannot accept POST requests. Send the form to a form-backend service or an Apps Script web app.

Can a static HTML page save data?

In the visitor's browser with localStorage, yes. To collect data from many visitors you need an external service.

Read next

Paste HTML. Get a URL.

Code, an .html file, a ZIP or a whole folder becomes a live HTTPS URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep URLs online for good.

Convert HTML to URL