title: Set the default value for views 3 in drupal 7
body: <p>so I have this exposed from and I want to change the default value when the view is displayed. I did search and found many articles on it but either they are for older versions of views or seem to be incomplete or maybe I am wrong somewhere.</p>
  
  <p>Ref  articles:
  drupal.org/node/635242
  <a href="https://drupal.stackexchange.com/questions/1812/change-the-default-selection-for-a-views-2-exposed-filter">https://drupal.stackexchange.com/questions/1812/change-the-default-selection-for-a-views-2-exposed-filter</a></p>
  
  <p>Most of them suggest using hook_form_alter but I think as we are using views hook form alter is called too late. Any help will be much appreciated.</p>
  
  <pre><code>function modulename_form_alter(&amp;$form, $form_state, $form_id) {
  
  if($form['#id'] == 'name-of-the-views-form-displayed') {
   if (empty($_GET['label-of-the-filter']))  {
  $form_state['input']['label-of-the-filter'] = 'default-value-for-filter';
   }
  }
  }
  </code></pre>