Static sites

Static site contact form templates, ready to paste

Four ready-made contact form templates — minimal, business, GDPR-consent, and single-field. Copy one, point it at your endpoint, and it's live.

A contact form is usually the one interactive thing a static site needs, so it's worth getting the fields right rather than reaching for the first template you find. Below are four versions built for different situations — pick one, replace your-form-id with your own endpoint, and publish.

For the full explanation of why a static site needs an endpoint like this at all — and step-by-step setup per framework — see the static website form submission guide. This page focuses specifically on contact forms: which fields to include, and which template fits your situation.

Four templates, pick one

Every field name is yours to change — only the action URL needs to point at your endpoint.

Minimal

A portfolio or personal site — just enough to let someone reach you.

html
<form action="https://onsubmit.dev/f/your-form-id" method="POST">
  <input name="name" placeholder="Your name" required />
  <input name="email" type="email" placeholder="Email" required />
  <textarea name="message" placeholder="Message" required></textarea>
  <button type="submit">Send</button>
</form>

Business / agency

Adds a company field and a subject dropdown so enquiries arrive pre-sorted.

html
<form action="https://onsubmit.dev/f/your-form-id" method="POST">
  <input name="name" placeholder="Your name" required />
  <input name="company" placeholder="Company (optional)" />
  <input name="email" type="email" placeholder="Email" required />
  <select name="subject" required>
    <option value="">What's this about?</option>
    <option value="sales">Sales enquiry</option>
    <option value="support">Support</option>
    <option value="partnership">Partnership</option>
  </select>
  <textarea name="message" placeholder="Message" required></textarea>
  <button type="submit">Send message</button>
</form>

With GDPR consent

Adds an explicit opt-in checkbox for sites that need recorded consent to store contact data.

html
<form action="https://onsubmit.dev/f/your-form-id" method="POST">
  <input name="name" placeholder="Your name" required />
  <input name="email" type="email" placeholder="Email" required />
  <textarea name="message" placeholder="Message" required></textarea>
  <label>
    <input type="checkbox" name="consent" required />
    I agree to be contacted about this enquiry.
  </label>
  <button type="submit">Send message</button>
</form>

Single-field

A landing page footer or exit-intent form — email only, lowest possible friction.

html
<form action="https://onsubmit.dev/f/your-form-id" method="POST">
  <input name="email" type="email" placeholder="you@example.com" required />
  <button type="submit">Get in touch</button>
</form>

Contact form best practices

A few decisions worth making deliberately before you publish.

Keep required fields to a minimum

Every required field is a chance for a visitor to give up. Name, email, and message cover almost every contact form — add more only when you'll actually act on the answer.

Add a subject field for routing

A subject dropdown or hidden category field doesn't route submissions on its own, but it lets you filter your inbox or trigger a webhook/Zapier automation based on the value.

Confirm the message was sent

Set a redirect URL to your own thank-you page from Settings → Redirect, or rely on the built-in confirmation page — either way, don't leave visitors wondering if it worked.

Skip the CAPTCHA if you can

Honeypot fields and keyword filtering stop most bots invisibly. Add a CAPTCHA only if spam keeps getting through, since it measurably reduces genuine submissions too.

Frequently asked questions

How many fields should a contact form have?

As few as the enquiry needs. Name, email, and message is enough for most sites — every additional required field lowers your completion rate, so add one only if you'll use the answer.

Should I add a CAPTCHA to my contact form?

Not by default. Honeypot fields and keyword filtering catch the majority of bots without asking visitors to prove they're human. Reach for a CAPTCHA only if spam keeps getting through after that.

Can I add a GDPR consent checkbox?

Yes — add a required checkbox input to the form, as in the template above. It submits as a normal field alongside the rest of the message, recording that the visitor opted in.

How do I show a thank-you message after someone submits?

Set a redirect URL for the form under Settings → Redirect in your dashboard, and visitors land on your own thank-you page after a successful submission. Leave it unset to use the built-in confirmation page instead.

Can I route support and sales messages to different places?

Not automatically by field value — every submission to a form goes to that form's configured destinations. Add a subject or category field to the form, then filter in your inbox or use a webhook/Zapier automation to route based on it.

Do these templates work in Hugo, Jekyll, Astro, and other generators?

Yes — every template here is plain HTML with no generator-specific syntax, so it works unchanged in any static site generator or hand-written page. See the static website form submission guide for framework-specific setup notes.

Put a contact form on your static site today

Free forever for up to 50 messages a month. One attribute, no backend, no credit card.