Created
November 1, 2019 20:56
-
-
Save ericjgruber/1275456f921940c0aa1c829895c13356 to your computer and use it in GitHub Desktop.
Searching for forms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_form_alter(). | |
*/ | |
function HOOK_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { | |
$formIds = [ | |
'eform-submission-guide-request-form' // Example of a $form_id. | |
]; | |
$formIds = str_replace('-', '_', $formIds); // Change the $form_id to something Drupal understands. | |
// Loop through any of the form ids listed in the $formIds array. | |
foreach ($formIds as $formId) { | |
if ($form_id == $formId) { | |
$form['#attributes']['novalidate'] = 'novalidate'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment