Whilst Drupal does document using multiple submit buttons here:
http://api.drupal.org/api/drupal/modules–node–node.pages.inc/function/node_form/7
For all the tea in china I couldn’t get this to work.
The form API seemed to pick up the first submit button and work with that.
print ‘<pre>’;
print_r($form_state);
print ‘</pre>’;
An array inside $form_state ['clicked_button'] showed that the clicked button was the first submit button in the form, not the button that was clicked.
$form_state ['values'] again shows the first submit button
Although $form_state['input'] did show that button that was clicked.
The answer in the end was very simple
All your submit buttons must share the same ‘#name’ value :
$form['another'] = array(
‘#type’ => ‘submit’,
‘#value’ => ‘Save and add another’,
‘#name’ => ‘attribute_save’,
‘#weight’ => 5,
‘#submit’ => array(‘product_another_submit’),
);
$form['return'] = array(
‘#type’ => ‘submit’,
‘#value’ => ‘Save and return’,
‘#name’ => ‘attribute_save’,
‘#weight’ => 10,
‘#submit’ => array(‘product_return_submit’),
);
$form['cancel'] = array(
‘#type’ => ‘submit’,
‘#value’ => ‘Cancel’,
‘#name’ => ‘attribute_save’,
‘#weight’ => 15,
‘#submit’ => array(‘product_cancel_submit’),
);
Hope that helps anyone else stuck with the same problem