You are here

function geocoder_element_validate in Geocoder 7

Geocoder element validate function.

1 string reference to 'geocoder_element_validate'
geocoder_field_widget_form in ./geocoder.widget.inc
Implements hook_field_widget_form().

File

./geocoder.widget.inc, line 235
geocoder.widget.inc

Code

function geocoder_element_validate($element, &$form_state) {
  if (!empty($element['geocoder_overridden']) && !empty($form_state['values'][$element['#field_name']][$element['#language']][$element['#delta']]['geocoder_overridden'])) {

    // Set the form state value on entity to persist the flag.
    $form_state['values']['geocoder_overridden'][$element['#field_name']][$element['#language']][$element['#delta']] = TRUE;
  }
  else {
    $form_state['values']['geocoder_overridden'][$element['#field_name']][$element['#language']][$element['#delta']] = FALSE;
  }
}