title: Handle multiple submit buttons in Drupal form API
body: <p>I have 2 submit buttons and want to perform different actions for each submit button . Here I want to set the form fields which can be done only in form_alter(). Can anyone suggest how to check for multiple submit buttons in the form_alter() function?</p>
  
  <p>I have used </p>
  
  <pre><code>function myform_form_submit($formID, &amp;$form_state) {
  if($form_state['clicked_button']['#value'] == $form_state['values']['submit_one'])    //if button 1      is clicked
       $form_state['redirect'] = 'mypath/page_one';   //redirect to whatever page you want
   else if($form_state['clicked_button']['#value'] == $form_state['values']['submit_two'])  /if button      2 is clicked
      $form_state['redirect'] = 'mypath/page_two';
   }
  </code></pre>
  
  <p>but this does not work</p>