search_form_submit

Versions
4.7 – 5
search_form_submit($form_id, $form_values)
6 – 7
search_form_submit($form, &$form_state)

Process a search form submission.

Code

modules/search/search.pages.inc, line 119

<?php
function search_form_submit($form, &$form_state) {
  $keys = $form_state['values']['processed_keys'];
  if ($keys == '') {
    form_set_error('keys', t('Please enter some keywords.'));
    // Fall through to the drupal_goto() call.
  }

  $type = $form_state['values']['module'] ? $form_state['values']['module'] : 'node';
  $form_state['redirect'] = 'search/'. $type .'/'. $keys;
  return;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.