I have a form generated using the Form API, which I'm having some success cleaning up with the use of the vertical tabs functions. I'd like to change which tab is active following a form submission, but am having no luck trying to do this by editing $form_state in the submit handler. '#default_tab' only works on the first form load.

What's the 'right' way of doing this?

Comments

karthikkumarbodu’s picture

Hi,
Try using the $form = form_builder($form_id, $form, $form_state); with the expected form id and you will get the form object which can be rendered on the required template.

Regards,
Karthik Kumar

Version: 7.20 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.