hform/guides

Add a Working Form to a Static Site

A static site can't process forms — there's no server code to receive them. It doesn't need any. The browser sends the form wherever its action address points, so a static page's form can post to a service that receives it, emails you, and stores the message. Your site stays pure HTML; this works on GitHub Pages, Vercel, Netlify, or a plain web host.

Step 1 — build your form and copy the HTML

Open the free hform builder, add the fields you want, and press Finish. Tell it where messages should go and you get a small block of HTML with the delivery address already filled in — plus a link to the form's own hosted page. No signup to build; you claim your messages by email when you're ready.

<form action="https://hform.com/s/your-form-id" method="POST">
  <label for="name">Name</label>
  <input id="name" name="name" required>

  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>

  <label for="message">Message</label>
  <textarea id="message" name="message" required></textarea>

  <button>Send</button>
</form>
<script src="https://hform.com/embed.js" defer></script>

(The real HTML from the builder also includes an invisible honeypot field and the script line above — together they are the form's spam protection, so keep them — plus a small optional stylesheet.)

Step 2 — paste it into your page

Put the HTML wherever the form belongs — in a raw HTML file, a Markdown file that allows HTML, or your static site generator's template. It's plain markup; style it with your own CSS or keep the small stylesheet the builder includes.

Step 3 — deploy and send a test message

Deploy the site as usual and submit the form once. When it works, a submission shows your visitor a clean thank-you page (or any page you choose), and the message lands in your email inbox with reply-to set to the sender — answer it like any other email. A copy stays in your hform inbox, downloadable as a spreadsheet.

What about Netlify Forms?

If you host on Netlify, its built-in form handling is a reasonable choice — a free allowance, upgrades beyond it. The trade-off is that it only works while you host there. A form posting to hform behaves the same on any host, moves with your site, keeps messages on an EU server with reply-to and CSV export, and the paid tiers start at $3/month. Pick whichever fits; the HTML is nearly identical either way.

A note on personal data

Form submissions are personal data. If EU residents can submit your form, GDPR expects you to say near the form what the data is used for, ask only for what you need, and delete what you no longer use. With hform your messages are stored in the EU (Sweden) with automatic retention limits — and a one-line privacy note under the form ("We use your details only to reply to your message") covers the common small-business case. The full picture, without legalese: GDPR and web forms in plain language.

Quick answers

Does this really work on GitHub Pages?

Yes. GitHub Pages serves only static files, but the form doesn’t need your server to do anything — the visitor’s browser posts the message straight to hform. The same goes for Vercel, Netlify or any plain web host.

Do I need JavaScript?

You don’t write any. The form itself is a standard HTML post; the one script line included in the code is the form’s built-in spam protection, and your visitors need JavaScript on — as virtually all browsers have — for their message to go through. After sending, your visitor lands on a clean thank-you page, or any address you choose.

How is spam handled without a server of my own?

Spam protection is built into the generated HTML and always on — every message must pass an invisible check, and anything that fails it never reaches your inbox or counts against your monthly quota.

Free — no signup

Build your form now

The hform builder gives you clean, accessible form HTML with delivery wired in — press Finish and paste it into a static site with the steps above. Free plan included; honest pricing if you outgrow it.

More platforms: WordPress · Shopify · Wix · Squarespace · Webflow — or see all guides.