form submit function never gets called. My drupal form submit function is not called. validation function is called. Form name is Mymodule_user_profile_form($form, &amp;$form_state), validation function name is Mymodule_user_profile_form_validate($form, &amp;$form_state) and submit function name is Mymodule_user_profile_form_submit($form, &amp;$form_state). I have studied all the previously asked questions.  

This is the last portion where I declare my submit button is defined. 

$form['profile']['profile-share']['profile-save-reset-btn']['submit'] = array(
  '#type' =&gt; 'submit',
  '#value' =&gt; t('Spara'),
  //'#name' =&gt; 'save-profile',
);


I have tried like this.

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


var_dump($form['#submit']); Shows the submit function but it's never called. Any Idea about this?
The submit function is correct. By default, Drupal should call Mymodule_user_profile_form_submit() function without declared it with the '#submit' attribute. Could you publish all the code to have a deeper exploration of it?



Edit:

You could try this:

$form['profile']['profile-share']['profile-save-reset-btn']['submit']['#submit'][] =  'Mymodule_user_profile_form_submit';


The atrribute is in the upper side of the rendering array. The attibute should be at the same level to be fired when the submit button is pressed:

Here an example of form api reference:

$form['actions']['delete'] = array(

  '#type' =&gt; 'submit',

  '#value' =&gt; t('Delete'),

  '#weight' =&gt; 15,

  '#submit' =&gt; array('node_form_delete_submit'),

 );


You could also attach the '#submit' in the upper level if you declare '#type' as 'form'. For example:

$form['#type'] = 'form';
$form['#submit'] = array('your_function');
$form['first_tree']['element'] = array( ... ) ;
$form['second_tree']['element'] = array( ... ) ;