public function AssetInjectorJsForm::validateForm in Asset Injector 8.2
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides AssetInjectorFormBase::validateForm
File
- src/
Form/ AssetInjectorJsForm.php, line 110
Class
- AssetInjectorJsForm
- Class AssetInjectorJsForm.
Namespace
Drupal\asset_injector\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
parent::validateForm($form, $form_state);
// Clear noscriptRegion if use_noscript is unchecked.
if (!$form_state
->getValue('use_noscript')) {
$form_state
->setValue('noscriptRegion', []);
}
}