How to override "action" of a form? after a form submission I want to redirect to an url. The "action" attribute of the form is ['#action']=homepage. How can I override this?

I have used this code

function custom_form_alter(&amp;$form, &amp;$form_state, $form_id) {  
  if ($form_id=='views-exposed-form-job-search-search-page') {
    global $base_url;
    $form['#action'] = $base_url.'/search/job'; 
  }
}


However it doesn't work, it still redirects me to /homepage. What am I missing?
Thanks
The $form_id argument is the internal form ID, not the CSS ID. For views exposed forms it'll always be views_exposed_form.

I think this is the easiest way to target a specific exposed form:

function MYMODULE_form_views_exposed_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $view = $form_state['view'];
  if ($view-&gt;name == 'foo' &amp;&amp; $view-&gt;current_display == 'bar') {
    // Alter the form...
  }
}