This project is not covered by Drupal’s security advisory policy.

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

Project information

Releases