Prompt

form wizard JavaScript

Technology / Developer Tools4 observationsLast seen Aug 27, 2026

Latest observation

Aug 27, 2026OpenAI APIWeb search: off

Here’s a simple multi-step form wizard in JavaScript with HTML/CSS/JS.

HTML

<form id="wizardForm">
  <div class="step active">
    <h2>Step 1</h2>
    <input type="text" placeholder="First Name" required />
    <button type="button" class="next">Next</button>
  </div>

  <div class="step">
    <h2>Step 2</h2>
    <input type="email" placeholder="Email" required />
    <button type="button" class="prev">Back</button>
    <button type="button" class="next">Next</button>
  </div>

  <div class="step">
    <h2>Step 3</h2>
    <input type="password" placeholder="Password" required />
    <button type="button" class="prev">Back</button>
    <button type="submit">Finish</button>
  </div>
</form>

CSS

.step {
  display: none;
}

.step.active {
  display: block;
}

JavaScript

const form = document.getElementById("wizardForm");
const steps = document.querySelectorAll(".step");
let currentStep = 0;

function showStep(index) {
  steps.forEach((step, i) => {
    step.classList.toggle("active", i === index);
  });
}

function validateStep(stepElement) {
  const inputs = stepElement.querySelectorAll("input");
  for (const input of inputs) {
    if (!input.checkValidity()) {
      input.reportValidity();
      return false;
    }
  }
  return true;
}

form.addEventListener("click", (e) => {
  if (e.target.classList.contains("next")) {
    if (validateStep(steps[currentStep])) {
      currentStep++;
      showStep(currentStep);
    }
  }

  if (e.target.classList.contains("prev")) {
    currentStep--;
    showStep(currentStep);
  }
});

form.addEventListener("submit", (e) => {
  e.preventDefault();
  if (validateStep(steps[currentStep])) {
    alert("Form submitted!");
  }
});

showStep(currentStep);

How it works

  • Only one .step is visible at a time.
  • Next validates the current step before moving forward.
  • Back moves to the previous step.
  • Finish submits the form after final validation.

If you want, I can also give you:

  1. a progress bar version
  2. a Bootstrap wizard
  3. a React form wizard
  4. a fully styled modern wizard

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (4 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.