Views Exposed Filter Form Submit handler I have a Views with an exposed filter block and put the block on the front page.

I use the following code to add a custom submit handler.

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form_id == 'views_exposed_form' )
  {
    array_unshift($form['#submit'], 'manage_custom_filters');
  }
}

function manage_custom_filters($form, &amp;$form_state) {
 dpm($form['#id']);  // output views name
}


Here is the question, whenever i load the front page, the manage_custom_filters get called, i suppose it will be called only when i submit the exposed filter form?

I did the same thing for node form submit, it does not behave like the views exposed filter form. manage_custom_filters only get called when i submit the form.

Is this the correct behavior of views exposed filter form?

How do i differentiate the manage_custom_filters is get called by 'on load' or submit action?
The views exposed form will be submitted every time you view it. If you check the render_exposed_form() you can see they are setting the $form_state['always_process'] =&gt; TRUE, this means that the form will be submitted always while processing it. And this is understanable because submitting the exposed form and passing the argument in $GET are the same in view.