1 field_test.field.inc field_test_widget_multiple_validate($element, &$form_state)

Form element validation handler for 'test_field_widget_multiple' widget.

File

core/modules/field/tests/field_test/field_test.field.inc, line 221
Defines a field type and its formatters and widgets.

Code

function field_test_widget_multiple_validate($element, &$form_state) {
  $values = array_map('trim', explode(',', $element['#value']));
  $items = array();
  foreach ($values as $value) {
    $items[] = array('value' => $value);
  }
  form_set_value($element, $items, $form_state);
}