Переопределить submit другой формы Drupal


function mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id=='search_block_form'){
$form['#submit'][0] = 'mymodule_search_box_form_submit';
}
}

function mymodule_search_box_form_submit($form, &$form_state){

}
?>

Категория: 
The code has been tested and works

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.