Forms alter submit button callback not working I have managed to override a profile2 form using hook form alter. After adding a second submit button to the form successful an issue arose. I can not get the call back function to work. Below is the hook and the call function. Can anyone see a issue with the code?

function multi_step_form_form_profile2_form_alter(&amp;$form, &amp;$form_state){    
          $form['profile_x']['field_personal_info']['submit']['und'][0] = array(
            '#name' =&gt; 'personal_info_alt',
            '#type' =&gt; 'submit',
            '#value' =&gt; t('Info Save'),
            '#attributes' =&gt; array('alt' =&gt; t('get data')),
            '#submit' =&gt; array('testing_to_see'),
          );
}



function testing_to_see() {
  print'I am in call back ';
  exit;

}


Thanks for the responses. The reason I am trying to add another submit button is that the current profile page is using JQuery to hide and display some field collections that have been added to the profile page.

Currently when the user fills out the inputs in a fieldset and clicks next it only hides that fieldset and then displays the next fieldset.

Now each fieldset needs to save the data on the server each time you press next. So I found a way to add a submit button using the above code and to display the next fieldset by unsetting the array. 

What I can't get the submit button to do when pressed is go to a call back function so I can manipulate the process to achieve this goal.

To answer the current questions below.


field_personal_info is adding the submit button inside the fieldset
multi_step_form is the name of the module
Expanding on my comment, be sure you have the correct form ID in the hook_form_FORM_ID_alter. This is an example of how I made this work. You'll need to modify the name of the hook and the FORM_ID

function tempo_form_profile2_edit_pet_ownder_form_alter(&amp;$form, &amp;$form_state){

    $form['actions']['new_button'] =  array(
            '#type' =&gt; 'submit',
            '#name' =&gt; 'personal_info_alt',
            '#value' =&gt; t('Info Save'),
            '#attributes' =&gt; array('alt' =&gt; t('get data')),
            '#submit' =&gt; array('testing_to_see'),      
        );
}

function testing_to_see(&amp;$form, &amp;$form_state) {
  drupal_set_message('I am in call back');
}