All Challenges

Multi-Step Form with Validation

AngularMediumRazorpayGrowwZerodha
45:00

Problem Brief

Create a 3-step KYC onboarding wizard enforcing field validation before moving Next, preserving values when going Back, and showing a submission summary.

Requirements

  • Display active step number (`1`, `2`, or `3`) cleanly in `[data-testid="step-indicator"]`.
  • Step 1 validates non-empty `[data-testid="name-input"]` before moving to Step 2.
  • Step 2 validates `[data-testid="email-input"]` contains `@` before moving to Step 3.
  • Clicking `[data-testid="submit-btn"]` on Step 3 reveals `[data-testid="summary-card"]` containing entered Name & Email.
Progressive Hints (1)
  • Persist `formData = { name, email }` in state rather than reading destroyed DOM inputs after step switch.
Reference Solution

Stuck? Load the verified reference code into your editor.

Automated Test Suite

5 Test Cases Ready
  • Blocks Step 1 progression if name is emptyStays on Step 1 and renders error message when name is blank
  • Advances from Step 1 to Step 2 with valid nameReveals step-2 when name is filled
  • Blocks Step 2 progression for invalid emailRejects email missing @ and stays on Step 2
  • Preserves name input when clicking Back from Step 2Step 1 input still retains value after going Back
  • Completes Step 3 and renders summary cardShows submitted name and email in summary-card
solution.html
Live Sandboxed Previewiframe sandbox
Starter template loaded — add your <script> logic in the editor (or open Reference Solution) to make the widget interactive.