You are here

function _ajax_countries_continent_widget_callback in Countries 7.2

Same name and namespace in other branches
  1. 8 countries.fields.inc \_ajax_countries_continent_widget_callback()

Returns the country element filtered by continent via AJAX.

1 string reference to '_ajax_countries_continent_widget_callback'
countries_field_widget_form in ./countries.fields.inc
Implements hook_field_widget_form().

File

./countries.fields.inc, line 363
All field related code.

Code

function _ajax_countries_continent_widget_callback($form, $form_state) {
  $parents = $form_state['triggering_element']['#array_parents'];
  array_pop($parents);
  $parents[] = 'iso2';
  $element = drupal_array_get_nested_value($form, $parents);
  return $element;
}