Skip to content

Is it possible to force form reset on page leave? #2788

@nestordedios

Description

@nestordedios

Question

I have a multi-step form using page reload and I want to know if it is possible to force Formie form reset when the user navigates aways from the form page or closes the browser/browser tab.

I'm currently experiencing that, that a user that started filling in the form and when he/she closes the browser tab or navigates to another URL, when coming back at the form page he/she will continue on the page the user left on.

Is there a setting in the plugin to solve this? Is the following possible?

Additional context

Expected scenario:

  1. User navigates to the page and starts filling in the form and going to the next steps/pages of the form
  2. On page 3, the user navigates away by clicking on an internal/external link or closing the browser
  3. User gets warned that leaving the page will cause filled in data to be lost (beforeunload JS event)
  4. When the user comes back to the same form page the form starts empty on the first step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions