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

smitarai’s picture

$form_state['#submit'][] = 'display_manager_notification_submit';

should be

$form['#submit'][] = 'display_manager_notification_submit';