Change the submit handler of a form of a module
I think that it solves the problem to do like this 

$form['#submit'] = array("my_module_form_submit_handler");


Here's the whole function:

function my_theme_form_alter(&amp;$form, $form_state, $form_id) {
  $form['#submit'] = array("my_module_form_submit_handler");
}

function my_theme_form_submit_handler($form, &amp;$form_state) {
  drupal_set_message("The form is being submitted, do some extra stuff now...");
}