All pastes #2050543 Raw Edit

Untitled

public text v1 · immutable
#2050543 ·published 2011-04-25 17:32 UTC
rendered paste body
Cleaned and updated:

function hms_ac_adm_form_alter(&$form, $form_state, $form_id){
   drupal_set_message("Form ID is : " . $form_id);
	 drupal_set_message("Form type is : " . $form['type']['#value']);
	 
   // && ($form['type']['#value'] == 'sup_pt_visit')
   
    if (($form_id == 'sup_pt_visit_node_form') ) {
    // this is the form on-submit validation hook callback declaration
    drupal_set_message('Matched!');
    $form['#validate'][] = '_hms_ac_adm_sup_pt_visit_node_form_validate';
    $form['#submit'][]   = '_hms_ac_adm_sup_pt_visit_node_form_submit';
  	dpm($form);
	}
}

/**
 * Implementation of hook_form_validate.
 */
function _hms_ac_adm_sup_pt_visit_node_form_validate(&$form, &$form_state){
	drupal_set_message('<pre>:Validate -' . print_r($form, TRUE) . '</pre>');   	
}
/**
 * Implementation of hook_form_submit
 */
function _hms_ac_adm_sup_pt_visit_node_form_submit(&$form, &$form_state){
   drupal_set_message('<pre>:submit -' . print_r($form, TRUE) . '</pre>');   	
}