Modify values in a Drupal 8 form before submitting (as in a validation handler)

The comment to use #element_validate from blacklabel_tom is still valid for Drupal 8.

https://api.drupal.org/api/drupal/modules!field!field.api.php/function/hook_field_widget_form_alter/7.x

It worked!