This module enhances the Drupal Webform module with improved default settings and styling for easier use in local government contexts. It includes features like Ajax submission, submit-once functionality, warnings for unsaved changes, and a simplified interface by hiding less common webform elements. It also provides additional components for date inputs and address lookups.
This module is part of the LocalGov Drupal distribution.
It provides additional configuration, styling and components for the Drupal Webform module.
Install
PLEAE NOTE: By default, on initial install, localgov_forms will update the default webform.settings config:
Specifically, it:
- Enables Ajax by default for forms (individual forms can override this).
- Enables submit-once (prevents double button presses / slow connection retries etc.)
- Disables the browser back button during submission
- Warns about unsaved changes
- Enables the submission log.
- Sets plain-English defaults for the confirmation message
- Removes chevrons from wizard/preview button labels.
- Excludes a range of webform elements that are less likely to be used so the UI is easier for editors to navigate.
If you have already installed Webform and wish to preserve your existing settings, add the following to settings.php before installing this module (it can be removed afterwards):
$settings['localgov_forms_skip_webform_config'] = TRUE;
Additional components
- LocalGov Forms Date - A date input field based on the GDS Date Input pattern
- LocalGov address lookup - Webform element with a configurable address lookup backend. Geocoder plugins act as backends, see installation note below.
Plugins
- Personally Identifiable Information (PII) redactor from Webform submissions: At the moment, a plugin manager `plugin.manager.pii_redactor` and a sample plugin are provided.
Dependencies
Geocoder Plugins
To use the address field look-up a Geocoder Provider is required.
UK Councils will probably want to use the free-to-them OS Places geocoder. To enable this install LocalGov Geo module and the OS Places Geocoder Provider plugin. Once these packages are installed, the *Localgov OS Places* plugin will become available for selection from the Localgov address lookup element's configuration form.
In other countries another Geocoder Provider will be required.
For automated tests the Nominatim Geocoder Provider is necessary.
Editing webforms
Webforms in Drupal are config entities, therefore are by default exported with the website configuration.
It is often desirable that webforms are built and maintained by non-developers.
To avoid the configuration being removed by deployments, install the
Config ignore module and under /admin/config/development/configuration/ignore add the following:
webform.webform.*
webform.webform_options.*