Home / Forms and Input / Multi-step Form Wizard

Multi-step Form Wizard in JavaScript, Free with Live Demo

Free multi-step form in plain JavaScript. Split a long form into steps, check each step before moving on, show progress, save a draft and review everything before sending.

Open live demoDownload HTML fileView code on GitHub
Multi-step Form Wizard JavaScript project: a sign up form split into steps with checks, a progress bar and a saved draft

Runs on: Constraint Validation API. Works in all modern browsers.

What is the Multi-step Form Wizard?

A long sign up form split into four short steps: personal details, address, plan and a final review. You cannot move on until the current step is filled in correctly.

Your answers are saved as you type, so closing the tab or reloading keeps your progress. The last step shows everything before you send it.

Good for

  • Sign up and onboarding flows
  • Checkout and booking forms
  • Job and school applications
  • Quote and survey forms

What this project does

How it works

  1. Use the browser checksrequired, type="email" and pattern do the checking. checkValidity() on each field of the current step decides if you can move on.
  2. Show one step at a timeEvery step is a fieldset. Only the current one is visible, and the progress bar follows the step number.
  3. Save as you typeFormData turns the form into an object that is saved to localStorage on every change and restored on reload.

The key JavaScript

This is the heart of the project. The full file has the rest, including the screen layout and error handling.

next.onclick = () => {
  const fields = [...steps[current].querySelectorAll("input, select")];
  const bad = fields.find((f) => !f.checkValidity());
  if (bad) { error.textContent = bad.validationMessage; bad.focus(); return; }
  current++;
  localStorage.setItem("draft", JSON.stringify(Object.fromEntries(new FormData(form))));
  show(current);
};

How to use it

  1. Click Download HTML file above.
  2. Open the file in a code editor, like VS Code.
  3. Run it from a local server with npx serve . so the camera, microphone and AI features are allowed.
  4. Change the text and colors, then upload it to GitHub Pages, Netlify or your own site. It is one file with no build step.

Questions people ask

Why split a form into steps?

People are more likely to finish a form when each part looks short and they can see how far they have come.

Do I still need server side checks?

Yes. Browser checks help people fill the form in, but always check the data again on your server.

Where is the draft stored?

In localStorage on the visitor's own device. It is removed after the form is sent.

More Forms and Input projects