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.
By aibek76 on
I need to add DIVs around and tags for each form element in a custom form for theming purposes. I can do it in theme_form_element() function, however it will change the tags for all forms. Please suggest an approach to do it for a specific form.
Comments
You can use hook_form_FORM_ID
You can use
hook_form_FORM_ID_alter()
in your custom module to alter LABELS/FIELDS of the form before it renders.