Fix for Fix for Confirm Submission of Form

  1. <?php
  2.  
  3. function nodetype_submit_form_alter(&$form, $form_state, $form_id) {
  4.         if ( $form_id == 'twittamentary_node_form' ) {
  5.                 $form['form_array'] = array('#value' => '<pre>'. print_r($form,1) . '</pre>');
  6.  
  7.                
  8.                 $msg='Submit?';
  9.                 $form['buttons']['submit']['#attributes'] = array('onclick' => 'return confirm(\'' . $msg . '\')');
  10.                
  11.                 $form['buttons']['submit']['#value'] = t('Save Post');
  12.  
  13.        
  14.         }
  15.  
  16. }
  17.  
  18. ?>

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.