How do i control validateForm? how do i control: validateForm

public function validateForm(array &amp;$form, FormStateInterface $form_state) {
  // form validation here
  // if validation success then proceed to submit
  // else dont submit and send notification to the respective field
}


i have done my fields validation inside that method, however, how do i control from there?

how to stop the submit process if the validation failed?
and
how to send notification/error message to the respective field?

Thank you,
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().