#states on exposed filter form I have a #states on the exposed filter form as follow: 

If field_a == 'b' then field_b show, field_c hidden;

else if field_a == 'c' then field_c show, field_b hidden;


All fields here are Select list.

The states is working fine, problem is the value of the hidden filter is affecting the view result, which i dont want. 

Questions:

1) How to change the hidden field value back to default(to -Any- in Select List)? JQuery maybe?

2) How to avoid the hidden filter affecting the view result and to remove the filter (?...&amp;field_b=xxx) in the query string? 

updates: working code for states.

 $field_state = array( 'visible' =&gt; array(':input[name="field_a"]' 
 =&gt; array( array('value' =&gt; 'a') )),       );

 $form['field_a']['#states']   = $field_state
Though you have custom solutions in place, but a try for views_dependent_filters can be worth, this might be hint as well for your custom solution.

views_dependent_filters module:


  Allows the presence of exposed filters on a view to be controlled by
  values in another exposed filter. Dependent filters are hidden when
  not relevant, and their values are not considered when the exposed
  form is submitted.
  
  The module is compatible with both the Views basic and the Better
  Exposed Filters form plugins.