Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The tabs should not use the form api to be rendered,
it breaks any form you are trying to add inside tabs, and you cannot commit the forms at all.
HTML does not allows forms into forms.
It should be a generating function proper to tabs instead of using the form api of drupal.
Comments
Comment #1
nedjoTabs do not generate a
<form>
element.Can you post the code you're working with?
Comment #2
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedThis is the code:
And this is where I am calling the function:
Comment #3
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedSorry duplication.
Comment #4
nedjoIt's outputting a form because you're calling this through drupal_get_form(). If you don't want a form, use 'module_app' as the menu item callback.
Comment #5
nedjoAnd change the last line of the function to
(Though you'll probably want to change the variable name to e.g. $tabset.)
Comment #6
Sylvain Lecoy CreditAttribution: Sylvain Lecoy commentedThank you for this tip.
It was effectively the calling of drupal_get_form which added the form element (surely in the theme function).
I suggest you to update the tabsexample.module as well, this was confusing how to render tabs.