Warn when leaving unsaved forms

Created on 26 December 2018, almost 6 years ago
Updated 30 October 2023, about 1 year ago

Problem/Motivation

Leaving a form without clicking the submit button leads to lost information.

Proposed resolution

Show a simple popup when the user tries to leave a form after entering information into it.

There is a very simple contrib module that does this for node forms: https://www.drupal.org/project/node_edit_protection β†’

All it does is add a JS file to node form pages which monitors for changes to the form, and pops up a warning if you try to leave without submitting.

farmOS does not use nodes, but a similar script could be provided for other forms.

Remaining tasks

  • Decide where the script should live (in a new/existing module, or in farm_theme).
  • Decide which forms we want to provide protection on.
  • Copy script from node_edit_protection and modify it to work in farmOS.

User interface changes

A popup will be displayed if you try to navigate away from an entity form without saving it. You will have the option to discard changes and navigate away anyway.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024