about 11 years ago
At times we need to change the message that is displayed after a node is saved.Follwing code helps to customize using form_alter.
function mymodule_form_alter(&$form, &$form_state, $form_id) { if($form['form_id']['#value'] =='formvalue') { if($form['buttons']['submit']['#submit']){ $form['buttons']['submit']['#submit'][] = 'mymodule_submit_function'; } } } function mymodule_submit_function($form, &$form_state){ global $_SESSION; $insert = empty($form_state['values']['nid']); if($insert){ //Write your custom message text here if($form['nid']['#post']['form_id'] == 'formvalue'){ $keys = array_keys($_SESSION['messages']['status']); $last_key = end($keys); $message = 'My custom messge after node save'; $_SESSION['messages']['status'][$last_key] = $message; } } }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)