I am trying to write a custom handler for one of the Drupal 7 forms:
function mymodule_formid_alter(&$form, &$form_state, $form_id) {
array_unshift($form['#submit'], 'mymodule_formid_submit');
}
function mymodule_formid_submit($form, &$form_state) {
drupal_add_js('jQuery(document).ready(function () { alert("Hello!"); });', 'inline');
return
}
But it is not accessing the handler. Alter method is being called and printing 'mymodule_formid_submit' in the #submit array.
Maybe I am missing something, but exiting answers on Stack Overflow related to custom handlers are not helping in my case.
return
should bereturn;
).