Skip to the main content
{}
Back to all articles

Technical article

Build a multi-step form: UX, validation and conversion

Use multiple steps only when they genuinely simplify the flow, while keeping server-side validation, progress and recovery behaviour.

By Codegenie2 minute read
  • UX & accessibility
  • Build
  • multi-step
  • form
  • validation
  • conversion
Online form beside a padlock and security checks.
In this article

Split a long form into steps when those steps separate real decisions or input groups. A short contact form does not automatically improve with more screens. Good steps show progress, preserve inputs and allow recovery without starting again.

Group steps by meaning

An illustrative project intake could use project type, relevant details and review/contact. Mark optional stages as optional and skip irrelevant questions. Do not claim higher conversion without comparable measurements from the actual form.

Validate the step and the final submission

Validate only the fields for the current stepapp/Livewire/ProjectWizard.phpphp
final class ProjectWizard extends Component
{
    public int $step = 1;
    public string $email = '';

    public function next(): void
    {
        if ($this->step !== 1) return;

        $this->validateOnly('email', [
            'email' => ['required', 'email:rfc'],
        ]);

        $this->step++;
    }
}

This Livewire fragment validates one field before changing steps. It is not a complete wizard: bound the step on the server, validate the appropriate fields at each stage and validate all required inputs again on final submission. A public step property does not prove that previous stages were completed.

Progress also needs a focus plan

Make progress and action clearresources/views/livewire/project-wizard.blade.phpblade
<p aria-live="polite">Step {{ $step }} of 3</p>

@if ($step === 1)
    <label for="email">Email</label>
    <input id="email" type="email" wire:model.blur="email">
    @error('email') <p role="alert">{{ $message }}</p> @enderror
@endif

<button type="button" wire:click="next">Continue</button>

The fragment illustrates progress and a field error. Give the error a stable id and connect it with aria-describedby; set aria-invalid only when invalid. After a successful transition, move focus to the new step heading. The final button must perform final submission rather than simply incrementing the step again.

Illustrative recovery exercise

  • Complete the first step, move forward and back. Inputs remain available.
  • Change project type. Irrelevant previous answers must not be silently submitted.
  • Submit invalid contact details. The error identifies its field and is reachable without a mouse.
  • Simulate processing failure. Inputs remain usable and retrying does not duplicate the enquiry.

Separate demo, acceptance and receipt

The local developer-tools wizard demonstrates interaction. Its success message does not prove mail delivery. A real flow distinguishes a completed step, server acceptance and received mail. Measure step abandonment only with appropriate consent and without collecting field content.

Code examples are illustrative. They have not been executed in a complete Laravel project; adapt imports, relationships, routes and configuration to your project and test actual behaviour.

Last updated:

Need technical context for your own project?

Codegenie helps with Laravel applications, existing codebases, shared-hosting deployments and technical improvements.