Wizard

A multi-step form wizard with a visual step-progress strip, per-step validation, skippable steps, remote data binding, and structured AJAX submission. All field values are collected across steps and submitted as a single payload that includes a _wizard metadata block.

Registration Wizard (validation & skip)

Three-step registration flow. The Account step requires a username and e-mail before you can continue. The Profile step is optional and can be skipped. The Confirmation step shows a review panel and triggers AJAX submission.

These fields are optional — you can skip this step.

Review your details below, then click Create Account to complete registration.

Your details will appear here when you reach this step.

Wizard output will appear here after submission…
PHP

Order Wizard (remote data source)

Demonstrates ->dataUrl(): on initialisation the wizard fetches data from the server and pre-populates fields. The submit payload mirrors the structured _wizard metadata so the server knows exactly which steps were completed, skipped, and what data was entered at each step.

Review your order — then click Place Order.

Order summary will appear here.

Order wizard output will appear here…
PHP

PHP PHP Methods (Fluent)

Method / PropertyParametersDescription
$m->wizard($id)stringCreate a wizard instance.
->step($key, $title)string, stringAdd a new step. All following step-scoped calls apply to this step until the next ->step().
->icon($icon)stringFont Awesome icon for the step circle, e.g. fa-user or fas fa-user. When omitted the step number is shown.
->content($html)stringHTML content rendered inside this step's panel. Place Manhattan form components here.
->skippable()bool?Mark the step as skippable. A "Skip" link appears in the footer. Default: false.
->noReturn()bool?Mark the step as non-returnable. Once the wizard advances past this step the user cannot navigate back to it — the Back button and step indicator click are blocked. Default: false.
->validateFields($ids)string[]Bespoke validation: array of element IDs or name attributes that must be non-empty before advancing. Used when not using a Form + Validator.
->useValidator($formId)stringDelegate this step's validation to a Manhattan Validator attached to the <form> with the given ID. Takes precedence over ->validateFields(). The Form component's inline field errors are used; the wizard banner shows the summary message.
->validationMessage($msg)stringOverride the inline error message shown when required fields are empty.
->submitUrl($url)stringURL to POST the wizard payload to on final submission.
->dataUrl($url)stringURL to GET initial field values from. Response: {"success":true,"data":{…}}.
->submitMethod($method)stringHTTP method for submission. Default: POST.
->ajaxSubmit()bool?Submit via fetch() AJAX (default: true). Pass false for a standard form POST.
->onComplete($fn)stringName of a JS function invoked on successful submission. Receives the parsed server response.
->onStepChange($fn)stringName of a JS function called before each step change. Return false to cancel navigation.
->nextText($text)stringLabel for the Next button. Default: Next.
->prevText($text)stringLabel for the Back button. Default: Back.
->skipText($text)stringLabel for the Skip link. Default: Skip.
->submitText($text)stringLabel for the Submit button. Default: Submit.
->showStepCounter()bool?Show/hide the "Step X of Y" counter. Default: true.

JS JS Methods

Method / PropertyParametersDescription
m.wizard(id, options?)string, object?Get (or init) the wizard instance for the given element ID.
next()Validate the current step then advance to the next. Returns false if validation fails.
prev()Go to the previous step (no validation).
skip()Skip the current step (only if it is marked skippable). Returns false otherwise.
goTo(index)numberJump to a specific step by zero-based index. Does NOT validate. Completed-step circles are also clickable to navigate back.
submit()Validate the current step then submit the collected payload.
reset()Return to step 0 and clear all collected data.
getCurrentStep()Returns the config object for the active step: {index, key, title, skippable, noReturn, validateFields}.
getData()Returns the full payload that would be sent on submission, including the _wizard meta-block.
setFieldValue(fieldId, value)string, anyProgrammatically set a field value (supports Manhattan component wrappers).

EVENT Events

Event NameDetailDescription
m:wizard:stepchange{ from, to, direction, wizard }Fired on the wizard element before navigation. Call event.preventDefault() or return false from the onStepChange callback to cancel.
m:wizard:stepchanged{ from, to, direction, wizard }Fired after a successful step transition.
m:wizard:validate{ step, fields }Fired when step validation fails. fields is an array of invalid input elements.
m:wizard:submit{ data }Fired immediately before the AJAX/form submission. data is the full payload.
m:wizard:complete{ response }Fired on a successful submission response.
m:wizard:error{ error, response }Fired when the submission fails (network error or server error).