0

I want to create several forms from the same page. And these form I am generating from a custom module. I have already generated the function my_module_form (), but I can only create a single form. How can I generate more forms?

1 Answer 1

1

There's nothing limiting you to a single form, your page callback just needs to return a render array containing all of the ones you need:

return [
  'form_1' => drupal_get_form('MYMODULE_form_1'),
  'form_2' => drupal_get_form('MYMODULE_form_2')
  'form_3' => drupal_get_form('MYMODULE_form_3'),
];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.