Forms

Form Steps

Split a Webflow form into several steps — with branching, your own error messages and choice cards.

v1.1.010 kB gzipfree

View live demoGet the cloneableTutorial video
On this page

Add the script

Head code · inside <head>
<!-- FlowPowerUser · Form Steps -->
<script defer src="https://cdn.jsdelivr.net/npm/@flowpoweruser/attributes@1/form-steps.js"></script>

Once per project is enough, even if you use the solution on several pages: Project Settings → Custom Code → Head Code.

The script loads alongside the page without holding up rendering; it runs once the page is in place and does nothing while no fpu attribute is there.

Choose the build

Every step is an ordinary div block inside the form.

You build all steps below each other in the Designer — only one is ever visible. Two ways are common:

Example
Form Block          fpu-form-element="form"
└─ Form
   ├─ Div  Step 1      fpu-form-element="step"
   ├─ Div  Step 2      fpu-form-element="step"
   ├─ Div  Step 3      fpu-form-element="step"
   └─ Div  Button row
      ├─ Button        fpu-form-element="prev"
      ├─ Button        fpu-form-element="next"
      └─ Submit
Example
Div  Who are you?  fpu-form-element="step"
                   fpu-form-step-id="type"

Div  Company data  fpu-form-element="step"
                   fpu-form-step-if="customer=company"

Div  Private data  fpu-form-element="step"
                   fpu-form-step-if="customer=private"

Div  Submit        fpu-form-element="step"

Set the required attributes

Form block or form

Switches the solution on for this form.

Div block inside the form

Turns the div block into a step.

Button · link block · submit

Next. Validates the visible step first and stays put if something is missing.

Button · link block · submit

Back. No validation, and it follows the path actually taken — even after a jump.

Button · link block · submit

Submit. Only active on the last step.

Result in the markup
<form fpu-form-element="form">
  <div fpu-form-element="step" fpu-form-step-name="Contact">
    <input name="email" type="email" required>
  </div>

  <div fpu-form-element="step" fpu-form-step-name="Project">
    <textarea name="project" required></textarea>
  </div>

  <button fpu-form-element="prev">Back</button>
  <button fpu-form-element="next">Next</button>
  <input type="submit" value="Submit">
</form>

Two ways lead there, and they can be mixed.

A condition on the step decides whether the step is part of the path at all. A jump target on the answer sends the user straight to a specific step. Skipped steps count in neither progress nor counter, are not validated, and their fields are disconnected — so they never reach the submit either.

Condition and jump target

The step only belongs to the path when the expression is true.

Condition and jump target

Target ID for jumps.

Condition and jump target

Default target after this step.

Radio · checkbox · option · next button

If this answer is selected, next goes straight to the step with that ID.

Three answers, three paths
<!-- Step 2: the choice -->
<div fpu-form-element="step" fpu-form-step-id="choice">
  <label><input type="radio" name="goal" value="website"> Website</label>
  <label><input type="radio" name="goal" value="shop">    Online shop</label>
  <label><input type="radio" name="goal" value="support"> Support</label>
</div>

<!-- Only what matches the answer comes next -->
<div fpu-form-element="step" fpu-form-step-if="goal=website">…</div>
<div fpu-form-element="step" fpu-form-step-if="goal=shop">…</div>
<div fpu-form-element="step" fpu-form-step-if="goal=support">…</div>

<!-- Always last -->
<div fpu-form-element="step" fpu-form-step-id="submit">…</div>
Expressions in step-ifsame syntax as fpu-condition
plan=pro
Equality, case-insensitive, numbers compared as numbers.
plan!=basic
Inequality.
plan=basic|pro
Several allowed values for the same field.
menge>=5
Numeric comparison, also with <, > and <=. Both “19.99” and the German “19,99” are understood.
newsletter
Just the field name: true as soon as the field is ticked or filled.
plan=pro && menge>=5
AND — both parts must hold.
plan=pro || plan=team
OR — binds weaker than AND, so it groups the AND parts.

Publish and check

Attributes only take effect on the published page — in the Designer the stack of steps stays visible, and that is correct.

If nothing happens, fpu-form-logging=“true” on the form helps: the console then reports in one line how many steps were found and how many of them are currently part of the path.

Optional

Your own error messages instead of the browser bubbleSet up error messages

Out of the box the solution validates every visible field of the step on next and shows the browser bubble.

As soon as you place an error element anywhere in the form, the text moves there — styled in the Designer, visible only when something is wrong. What gets validated still comes from the usual Webflow field settings (required, type, pattern, length).

When validation runs

On the form or on a single step

Clicking next validates the visible step.

Default: step
On the form or on a single step

Additionally when leaving a field — the error appears at once, not only at the end of the step.

On the form or on a single step

Only on submit, but then across every step of the path taken.

On the form or on a single step

No validation of our own.

Where the error appears

Text block inside the form

Carries the error text.

Text block inside the form

Binds the element to a specific field (its name or id) or to a group.

Text block inside the form

Optional wrapper around label, field and error.

Text block inside the form

Summary at the top of the step: a list of every error, each entry jumps to its field.

What the error says

On the field, otherwise on the form

Required field is empty.

On the field, otherwise on the form

There is also -url, -tel, -number and -pattern.

On the field, otherwise on the form

Plus -maxlength, -min, -max and -step. {min} and {max} insert the limit.

On the field, otherwise on the form

One message for every error on this field — handy when a field only has one failure mode.

On the field, otherwise on the form

Plain-text name for {label}.

A field with its own error text
<div fpu-form-element="field">
  <label for="mail">Email</label>

  <input id="mail" name="email" type="email" required
         fpu-form-label="your email"
         fpu-form-message-required="Without {label} we cannot reply."
         fpu-form-message-email="The @ is still missing.">

  <div fpu-form-element="error" fpu-form-error-for="email"></div>
</div>
Progress, counter and indicatorsBar, “step 2 of 4”, dot row

All three use the current path: if a step drops out through branching, it counts nowhere.

The elements may also sit outside the form — fpu-form-instance then connects them to the right form.

Display elements

Progress bar. The width is set in percent, your styling does the rest.

Display elements

Counter text. The built-in default is German — “Schritt {current} von {total}” — so set your own here for an English site.

Display elements

Custom counter format.

Display elements

Display name of the step.

Display elements

Shows the name of the current step (fpu-form-step-name).

Display elements

One dot or tab per step, in DOM order.

Display elements

Binds an indicator to a step ID.

Custom choice elements: radios, checkboxes, dropdownsCards, group requirement, auto-advance

Webflow can style radios and checkboxes, but it cannot make a whole card clickable or enforce “at least one choice”.

That is exactly what this adds. For styled dropdowns the native select stays the form field — combine it with fpu-select (Custom Form Select); focus and error marking then land on the visible trigger automatically.

Choice card

Div block with a radio or checkbox inside

The whole surface becomes clickable.

Group of radios or checkboxes

Div block around all answers

Combines the answers into one unit.

Div block around all answers

At least one choice.

Div block around all answers

Minimum number of ticks for checkbox groups.

Div block around all answers

Maximum number of ticks for checkbox groups.

Div block around all answers

Name of the group.

Div block around all answers

Custom text for the group.

Div block around all answers

Advance automatically after a radio choice.

Div block around all answers

Delay in milliseconds, so the choice stays visible for a moment.

Required choice with cards
<div fpu-form-element="group"
     fpu-form-group="goal"
     fpu-form-required="true"
     fpu-form-auto-next="true"
     fpu-form-label="a goal"
     fpu-form-message-group-required="Please pick what this is about.">

  <label fpu-form-element="choice">
    <input type="radio" name="goal" value="website" fpu-form-goto="website">
    <span>New website</span>
  </label>

  <label fpu-form-element="choice">
    <input type="radio" name="goal" value="shop" fpu-form-goto="shop">
    <span>Online shop</span>
  </label>

  <div fpu-form-element="error" fpu-form-error-for="goal"></div>
</div>
More settingsPersistence, scrolling, several forms
On the form

Store entries and the step reached for the session and restore them on return.

Default: false
On the form

Scroll to the top of the form on every step change.

Default: false
On the form

Connects elements outside the form — progress, counter, indicators, buttons — to exactly this form.

On the form

One line in the console on start: version, number of steps, validation mode.

Default: false
Global defaults for every form
<script>
  window.fpuFormStepsConfig = {
    persist: true,
    scroll: true,
    validate: "live",
    countTemplate: "Step {current} of {total}",
    messages: {
      required: "We still need this.",
      email: "Please use a valid email address.",
    },
  };
</script>
Keyboard, classes and eventsfor animations and your own script

Enter in a field means next instead of submit, except on the last step.

Alt+arrow right and left page through, as long as focus is not in a text field or dropdown. After every change focus jumps to the first field of the new step.

Classes you can style

fpu-form-step-active
The currently visible step.
fpu-form-step-skipped
A step that branching has currently taken out of the path.
fpu-form-invalid
On the field that failed.
fpu-form-field-invalid
On the field wrapper and on the group.
fpu-form-choice-selected
On the selected choice card.
fpu-form-btn-disabled
On buttons that cannot do anything in the current step.

Events on document

fpu:form-step-changed
After every change. detail: form, index, total, stepId, stepIndex.
fpu:form-invalid
For every message shown. detail: form, element, message.
fpu:form-valid
When a submit passed validation and is let through.
How it works

Form Steps turns an ordinary Webflow form into a multi-step form. It stays a Webflow form: submit, success and error states, Zapier, Make and every integration keep working. Only what happens between the first field and the submit is new.

  • Branching: the answer in step 2 decides which steps come up at all.
  • Your own error messages instead of the browser bubble, per field or per form.
  • Required fields apply per step: you only move on once the visible step is complete.
Additional features
  • Webflow submit stays untouchedValidation runs before Webflow's own handler. Invalid or premature submits never reach Webflow — success state, error state and every connected service behave as usual.
  • Back follows the real pathAfter a jump, back leads to where you actually came from, not to the previous element in the Designer.
  • Cleanly removablewindow.fpuFormSteps.destroyAll() removes every listener, class and ARIA attribute and restores the initial state — for page transitions and single-page environments.
  • Accessible out of the boxSteps are named groups, inactive steps are inert and gone for screen readers, progress is a progressbar, errors are announced as alerts and tied to the field via aria-describedby.

Access currently by invitation only