Guest User

Untitled

a guest
Jul 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public function validateForm(array &$form, FormStateInterface $form_state) {
  2. $values = $form_state->getValues();
  3. if ($values['my_field'] == 'some_forbidden_value') {
  4. $form_state->setErrorByName('my_field', $this->t('This value is forbidden!'));
  5. }
  6. }
Add Comment
Please, Sign In to add comment