Skip to content
Snippets Groups Projects
Commit fe341951 authored by Sébastien Brindle's avatar Sébastien Brindle
Browse files

Fix form novalidate attribute on webform.

parent c344ef55
Branches
Tags 1.1.1
No related merge requests found
......@@ -9,7 +9,6 @@ declare(strict_types=1);
use Drupal\Component\Utility\Crypt;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element;
/**
* Implements hook_form_FORM_ID_alter() for "node_preview_form_select".
......@@ -59,6 +58,16 @@ function dsfr4drupal_preprocess_form(array &$variables): void {
}
}
/**
* Implements hook_preprocess_HOOK() for "webform".
*/
function dsfr4drupal_preprocess_webform(array &$variables): void {
// Disable browser validation of form fields.
if (theme_get_setting('form_novalidate')) {
$variables['attributes']['novalidate'] = 'novalidate';
}
}
/**
* Implements hook_preprocess_HOOK() for "form_element".
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment