How do i control validateForm?
public function validateForm(array &amp;$form, FormStateInterface $form_state) {
  parent::validateForm($form, $form_state);
  $values = $form_state-&gt;getValues();
  if ($values['your_field'] == 'some_forbidden_value') {
      $form_state-&gt;setErrorByName('your_field', $this-&gt;t('This value is forbidden!'));
   }
}


About setErrorByName().