You are here

function trim_form_values in Trim 8

Same name and namespace in other branches
  1. 7 trim.module \trim_form_values()

Validation callback function. Trim the values of the form.

1 string reference to 'trim_form_values'
trim_form_alter in ./trim.module
Implements hook_form_alter().

File

./trim.module, line 29
Trim module.

Code

function trim_form_values(&$form, FormStateInterface $form_state) {
  foreach ($form_state
    ->getValues() as $key => $value) {
    trim_value($value);
    $form_state
      ->setValue($key, $value);
  }
}