leave_confirm
The Leave Confirm module for Drupal improves user experience by showing a popup confirmation dialog when users attempt to leave a page with unsaved changes in specified forms. This prevents accidental loss of data and allows users to confirm their intention before navigating away.
Administrators can configure the module for specific forms, control permissions, and manage settings easily through a user-friendly interface. It ensures critical form data is protected across the site without disrupting the workflow.
Installation
- Install the Leave Confirm module via Composer:
composer require drupal/leave_confirm - Or install it as a standard contributed Drupal module. See:
https://www.drupal.org/docs/8/extending-drupal-8/installing-modules
Features
- Configurable Leave Confirm Dialogs: Display confirmation dialogs for specific forms to prevent accidental data loss.
- Role-Based Permissions: Control which user roles can access and configure Leave Confirm settings.
- Pre-Configured Defaults: Automatically adds points for common forms (user forms, node forms, webform forms) on installation.
- Enable/Disable per Form: Toggle Leave Confirm functionality for individual form points as needed.
- Add New Form Points: Easily add new forms to be protected via the module configuration.
- User-Friendly Interface: Manage leave confirmation settings conveniently at
admin/config/user-interface/leave-confirm-points.
Post-Installation
After installing the Leave Confirm module, follow these steps to set up and manage it:
- Enable the module from Extend in the Drupal admin interface.
- Configure leave confirmation for default forms or add new form points at
admin/config/user-interface/leave-confirm-points. - Set permissions for different user roles to control access to Leave Confirm settings at
/admin/people/permissions/module/leave_confirmto manage configuration access.
The module is now ready to protect your forms from accidental navigation and unsaved changes.
Additional Requirements
- Drupal Version: 10 or higher
- Browser Support: Modern browsers with JavaScript enabled (Chrome, Firefox, Safari, Edge, etc.)
Recommended Modules/Libraries
No additional modules or libraries are required. For best results, use a modern theme that supports standard form rendering.
Similar Projects
Troubleshooting & FAQ
- Popup not appearing? Ensure the module is enabled and configured for the intended form IDs.
- Permission issues? Verify that the user role has access to configure Leave Confirm settings.
Support
Please post bug reports, feature requests, or support inquiries to the Leave Confirm module issue queue.