how to alter exposed form values before submit for filters in drupal7 view I want to do left and right trim when end user enters data in textbox for filter list of rows in drupal 7 views
function example_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 array_unshift($form['#validate'], 'example_request_validate');
}

function example_request_validate(&amp;$form, &amp;$form_state) {
  if (isset($form_state['values']['text_field']) &amp;&amp; !empty($form_state['values']['text_field'])) {
    $request_id = $form_state['values']['field_request_id_value'];
    if (strchr($request_id,''))) {
      $request_id = ltrim(strchr($request_id,''), '');
    }
    form_set_value($form['text_field'], $request_id, $form_state);
  }
}