NPS survey

Net Promoter Score survey with a 0-10 rating.

Why these fields

  • Email: Email provides a validated reply address but remains optional.
  • How likely are you to recommend us? (0-10): How likely are you to recommend us? (0-10) collects a value that can be validated and compared and is required to complete the request.
  • What is the main reason for your score?: What is the main reason for your score? leaves room for context and detail but remains optional.

Fields

EmailemailHow likely are you to recommend us? (0-10)numberrequiredWhat is the main reason for your score?textarea

Preview

Code

import { useState } from "react";

export function NpsSurveyForm() {
  const [sent, setSent] = useState(false);

  async function onSubmit(e: React.FormEvent<HTMLFormElement>) {
    e.preventDefault();
    const form = e.currentTarget;
    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();
    }
  }

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

  return (
    <form onSubmit={onSubmit}>
      <label htmlFor="email">Email</label>
      <input type="email" name="email" id="email" />
      <label htmlFor="score">How likely are you to recommend us? (0-10)</label>
      <input type="number" name="score" id="score" required />
      <label htmlFor="reason">What is the main reason for your score?</label>
      <textarea name="reason" id="reason" />
      <input
        type="text"
        name="_gotcha"
        tabIndex={-1}
        autoComplete="off"
        style={{ position: "absolute", left: "-9999px" }}
        aria-hidden="true"
      />
      <button type="submit">Send</button>
    </form>
  );
}

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 with Formward

Create a form, copy your endpoint, and replace https://forms.formward.eu/f/your-form-id in the code above.

NPS survey template, copy-paste code | Formward