drupaldrupal-fapidrupal-forms

In Drupal 7 form API - How do I create an input of type "button" (not "submit")?


I am trying to have a button which is not a "submit" type of button, but rather a normal "button" type, using the forms api of drupal 7, but I can't seem to get it.

I've tried many things, like setting #type to 'button', setting #button_type to 'button' but no matter what I do, drupal always creates a button of type "submit".


Solution

  • You may want to check out this issue for some background and then consider this workaround. You might also be able to use #markup to insert it manually.