You are here

public function GeocoderProviderCreationForm::validateForm in Geocoder 8.3

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 FormBase::validateForm

File

src/Form/GeocoderProviderCreationForm.php, line 122

Class

GeocoderProviderCreationForm
Provides a simple form that allows to select the provider type.

Namespace

Drupal\geocoder\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  if (!$form_state
    ->getValue('geocoder_provider')) {
    $form_state
      ->setErrorByName('geocoder_provider', $this
      ->t('A Geocoder Provider to add should be selected.'));
  }
}