function search_box_form_submit in Drupal 6
Same name and namespace in other branches
- 4 modules/search.module \search_box_form_submit()
- 5 modules/search/search.module \search_box_form_submit()
- 7 modules/search/search.module \search_box_form_submit()
Process a block search form submission.
Related topics
1 string reference to 'search_box_form_submit'
- search_box in modules/
search/ search.module - Form builder; Output a search form for the search block and the theme's search box.
File
- modules/
search/ search.module, line 1080 - Enables site-wide keyword searching.
Code
function search_box_form_submit($form, &$form_state) {
// The search form relies on control of the redirect destination for its
// functionality, so we override any static destination set in the request,
// for example by drupal_access_denied() or drupal_not_found()
// (see http://drupal.org/node/292565).
if (isset($_REQUEST['destination'])) {
unset($_REQUEST['destination']);
}
if (isset($_REQUEST['edit']['destination'])) {
unset($_REQUEST['edit']['destination']);
}
$form_id = $form['form_id']['#value'];
$form_state['redirect'] = 'search/node/' . trim($form_state['values'][$form_id]);
}