public function sio__vocabulary_widget::validate

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

Overrides TripalFieldWidget::validate

See also

TripalFieldWidget::validate()

File

tripal_chado/includes/TripalFields/sio__vocabulary/sio__vocabulary_widget.inc, line 72

Class

sio__vocabulary_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 cv_id
  $cv_id = $form_state['values'][$field_name][$langcode][0]['chado-' . $field_table . '__cv_id'];
  $form_state['values'][$field_name][$langcode][0]['value'] = $cv_id;
}