Handle multiple submit buttons in Drupal form API

Posted by Jessica Taylor | Updated on

IF you want to handle multiple submit buttons in Drupal form API? The best thing to do if you have two submit buttons on a form and want them to do different things, is to create a different submit function for each button, and connect them up. One of the nice things about the FormAPI is that it automatically links the form with the submit handler for you, but if you have two submit buttons you want to go somewhere new.

Reference: https://stackoverflow.com/questions/4501890/handle-multiple-submit-buttons-in-drupal-form-api


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers