Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Form change warning

No security coverage Maintenance fixes only 2 sites

This module adds a warning message to forms when users make changes but haven't saved them. It helps prevent accidental data loss by prompting users before they navigate away from a modified form.

You can display the "You have unsaved changes" warning on a form when any input has been changed.

Just attach the defined library to your form.

/**
 * Implements hook_form_alter().
 */
function YOURMODULE_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $form['#attached']['library'][] = 'form_change_warning/form_change_warning';
}

Similar modules

Confirm Leave

Ask your assistant about Form change warning

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Jan 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Releases

Version Type Core PHP Release date
1.0.0-alpha1 Pre-release 10–11 Jan 10, 2025
1.0.x-dev Dev 10–11 Jan 10, 2025