Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By KayBe on
How can I choose a different message after a form submit that is dependent on the validation?
I tried to add $form_state['#submit'][] = 'display_manager_notification_submit';
and then unsetting the messages in the submit handler and adding my own message.
function display_manager_notification_submit(&$form, &$form_state) {
unset($_SESSION['messages']['status']);
drupal_set_message('Your registration request is forwarded to your manager for approaval', 'status', true);
}
But this does not work. In fact the whole submit function seems to be ignored.
Regards,
Kris
Comments
$form_state['#submit'][] =
$form_state['#submit'][] = 'display_manager_notification_submit';
should be
$form['#submit'][] = 'display_manager_notification_submit';