Filtering among Exposed Filters : Parent/Child relationship between two Exposed Filter in Drupal View I wanted to make a page with exposed filter search app in Drupal for a list of people.

I started by creating content type Bio and populated it as following:-



Then, I continued making a view with exposed filters of the fields of content type Bio. With the help of Better Exposed Filters, I am showing both Filters through Checkboxes through AJAX, as below:-



Now, until now, it's working fine. when I select a region or/and any city, the content updates according to that.

What I am hoping to create is a dependency between the region and city. All I want is that when I select any region in the Filter by Region, the lower filter values in the Filter by City automatically adjust and show me only the cities for which the region field in Bio is the selected city.

As an example, If a user selects EMEA, the city exposed filters should only show European cities.

I have been stuck in this for hours now. I have tried various solutions (View Dependent Filtersand Filter Fields) but to no avail.

I'll be therefore very thankful for any help whatsoever.
Look at my currently developing site's exposed filter(where 'Бренд' and 'Модель' fields): Link

If you want to achive this kind of functionality then you can achieve it like this. First you need to alter exposed filter function:

function MY_MODULE_form_views_exposed_form_alter(&amp;$form, &amp;$form_state) {
  if ($form['#id'] == 'views-exposed-form-VIEWS_NAME_VIEWS_DISPLAY') {
    if(!empty($form_state['values'])) {
      $form_state['input'] = array_merge($form_state['input'],$form_state['values']);
    }

    // Marks
    $mark_childs = populate_terms_by_vocab('transport_models', TRUE, FALSE);
    $form['field_adv_mark_tid']['#options'] = array('All' =&gt; t('--Выберите')) + $mark_childs;
    $form['field_adv_mark_tid']['#ajax'] = array(
      'callback' =&gt; 'adv_mark_callback',
      'wrapper' =&gt; 'model-wrapper',
      'effect' =&gt; 'none',
      'progress' =&gt; array(
        'type' =&gt; 'throbber',
        'message' =&gt; '',
      ),
    );
    // marks end

    // Models begin
    $selectedMark = isset($form_state['input']['field_adv_mark_tid']) ? $form_state['input']['field_adv_mark_tid'] : NULL;

    if($selectedMark != NULL || $selectedMark != FALSE) {
      $model_childs = populate_terms_by_vocab('transport_models', FALSE, $selectedMark);
    }
    elseif($selectedMark == NULL || $selectedMark == FALSE) {
      $model_childs = array();
    }

    $form['field_adv_model_tid']['#options'] = array('All' =&gt; t('--Выберите')) + $model_childs;
    $form['field_adv_model_tid']['#prefix'] = '&lt;div id="model-wrapper"&gt;';
    $form['field_adv_model_tid']['#suffix'] = '&lt;/div&gt;';
    // models end
  }
}

// This is an Ajax callback for $form['field_adv_mark_tid']['#ajax']
function adv_mark_callback($form, $form_state) {
  return $form['field_adv_model_tid'];
}

// This is a helper function which returns terms (suitable for form selectlist, checkboxes or radios..)
function populate_terms_by_vocab($vocabulary_machine_name, $only_parents = TRUE, $parent = FALSE) {
  $vocab = taxonomy_vocabulary_machine_name_load($vocabulary_machine_name);
  $terms = array();
  if($parent == FALSE) {
    $terms = taxonomy_get_tree($vocab-&gt;vid, 0, NULL, FALSE);
  }
  elseif($parent == TRUE) {
    $terms = taxonomy_get_tree($vocab-&gt;vid, $parent, NULL, FALSE);
  }

  $child_terms = array();
  foreach($terms as $key =&gt; $value) {
    if($only_parents &amp;&amp; $terms[$key]-&gt;parents[0] == 0) {
      $child_terms[$terms[$key]-&gt;tid] = $terms[$key]-&gt;name;
    }
    elseif($only_parents == FALSE &amp;&amp; $terms[$key]-&gt;parents[0] != 0) {
      $child_terms[$terms[$key]-&gt;tid] = $terms[$key]-&gt;name;
    }
  }

  return $child_terms;
}


I thinks the logic is the same.. In my case, I am adding to my entity type the two same term reference fields, and on content creation form I am displaying them as different parent field and child field (with pre-render function). By that, first field is holding the top level terms, the second field is holding child terms. And by views ui I am exposing them separately. And, that piece of code is displaying them as I want..