public function uo__unit_widget::validate

3.x uo__unit_widget.inc public uo__unit_widget::validate($element, $form, &$form_state, $langcode, $delta)

Overrides TripalFieldWidget::validate

See also

TripalFieldWidget::validate()

File

tripal_chado/includes/TripalFields/uo__unit/uo__unit_widget.inc, line 53

Class

uo__unit_widget

Code

public function validate($element, $form, &$form_state, $langcode, $delta) {

  $field_name = $this->field['field_name'];
  $field_table = $this->instance['settings']['chado_table'];

  // Make sure the value is set to the organism_id
  $unittype_id = $form_state['values'][$field_name]['und'][0]['chado-' . $field_table . '__unittype_id'];
  $form_state['values'][$field_name]['und'][0]['value'] = $unittype_id;
}