Skip to content
Formward
Log inStart free

Contact forms · 3 fields

Simple contact form template

Three fields for a personal site, a portfolio or a small business with one inbox. If several people answer different kinds of question, the contact us template adds a topic field for that.

Get the code

Simple contact

Live demo: try the fields. Submitting sends nothing.

Why these fields

  • Name

    text · required

    Required, so you can greet the sender. A single field copes with every naming convention; first and last name boxes do not.

  • Email

    email · required

    Required. Because the field is named email, your notification arrives with this address as Reply-To and you answer by pressing reply.

  • Message

    textarea · required

    Required textarea with no length limit in the markup. Add maxlength if you want to keep essays and pasted spam short.

When to use it

Use it on a portfolio, a personal blog or the site of a one-person business. Three fields are quick to fill in on a phone, which is where most contact forms are opened.

Resist adding fields until a real need appears. A subject line or a phone number can come in the first reply.

Privacy and GDPR

  • A short line under the button saying you use the details only to reply, with a link to your privacy notice, is all this form needs.
  • Old messages pile up fast on a personal site. Delete conversations that are finished, or let the form's retention period do it.

Choose your stack. Copy your form.

Replace the example endpoint with your Formward endpoint, then adapt the fields to your needs.

<form action="https://forms.formward.eu/f/your-form-id" method="POST">
  <label for="name">Name</label>
  <input type="text" name="name" id="name" required />
  <label for="email">Email</label>
  <input type="email" name="email" id="email" required />
  <label for="message">Message</label>
  <textarea name="message" id="message" required></textarea>
  <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="position:absolute;left:-9999px" aria-hidden="true" />
  <button type="submit">Send</button>
</form>

Accessible by default, and how to keep it that way

  • Every field in the code has a visible label tied to it with for and id, so screen readers announce what to enter and a click on the label focuses the field.
  • Required fields carry the required attribute, so the browser explains a missing answer before anything is sent. Say “required” in words as well; an asterisk or a colour alone is easy to miss.
  • The spam trap field (_gotcha) is hidden from screen readers with aria-hidden and skipped by the Tab key, so people never meet it.
  • In the JavaScript versions, show the confirmation or error in an element with role="status" so the result is announced, and keep the entered answers when sending fails.

Changed the fields? Paste your version into the HTML form tester to see exactly what it sends, or run it through the GDPR form checker.

How the code talks to Formward

Each form you create gets its own endpoint in the form https://forms.formward.eu/f/your-form-id. The HTML version posts to it directly and the browser is redirected to a thank-you page, so it works without JavaScript.

The Next.js version below sends the same fields with fetch and an Accept: application/json header. Formward then answers with { ok: true, id }, or an error body with 402 when the account is over its allowance and its Over limit folder is full, and 429 when the rate limit kicks in. See responses and status codes.

Next.js client component

"use client";

import { useState } from "react";

export function SimpleContactForm() {
  const [sent, setSent] = useState(false);
  const [error, setError] = useState("");

  async function onSubmit(e: React.FormEvent<HTMLFormElement>) {
    e.preventDefault();
    const form = e.currentTarget;
    setError("");
    try {
      const res = await fetch("https://forms.formward.eu/f/your-form-id", {
        method: "POST",
        headers: { Accept: "application/json" },
        body: new FormData(form),
      });
      if (res.ok) {
        setSent(true);
        form.reset();
        return;
      }
    } catch {
      // Network failure: fall through to the same message.
    }
    // The answers stay in the form so the visitor can try again.
    setError("Sending failed. Please try again.");
  }

  if (sent) return <p role="status">Thanks! Your message has been sent.</p>;

  return (
    <form onSubmit={onSubmit}>
      <label htmlFor="name">Name</label>
      <input type="text" name="name" id="name" required />
      <label htmlFor="email">Email</label>
      <input type="email" name="email" id="email" required />
      <label htmlFor="message">Message</label>
      <textarea name="message" id="message" required />
      <input
        type="text"
        name="_gotcha"
        tabIndex={-1}
        autoComplete="off"
        style={{ position: "absolute", left: "-9999px" }}
        aria-hidden="true"
      />
      <button type="submit">Send</button>
      <p role="status">{error}</p>
    </form>
  );
}

Spam protection

  • The generated code already includes the hidden _gotcha honeypot. Leave it in: a bot that fills it gets a normal success response, the submission is filed as spam and no email is sent.
  • Every form has a per-IP rate limit, and you can restrict it to your own domains with the allowed-origins list in the form settings.
  • Cloudflare Turnstile is optional and works on every plan, including Free. Turn it on in the form settings, add the widget to your markup and Formward checks the token server-side.
  • The form settings can also reject disposable email addresses, which is worth turning on when a fake address would waste your time.

What happens after submit

  • Each message lands in your inbox and in the dashboard on every plan. Free includes 50 submissions a month.
  • A hidden _subject field sets the subject of the notification, handy when several small sites share one inbox.
  • An automatic thank-you to the sender is the autoresponder, which starts at Personal.

Questions

Does a simple contact form need a CAPTCHA?
Often not. The honeypot field in the generated code and the per-IP rate limit stop most automated spam without bothering visitors. If spam still gets through, switch on Cloudflare Turnstile in the form settings.
Can I use it on a static site with no backend?
Yes, that is the usual case. The form posts straight to your Formward endpoint, so a plain HTML host or a static site generator works without server code.

Customize before publishing

  • Remove fields you do not need and mark only essential answers as required.
  • Replace placeholder wording with terms your audience already understands.
  • Add your privacy notice, retention details and expected response time.
  • Test keyboard focus, validation errors and the confirmation state on mobile.

Use this template

Create a free account and the form is set up from this template. Copy your endpoint and replace https://forms.formward.eu/f/your-form-id in the code above.

Use this template →

No website? Use a hosted form