O'Reilly logo

Drupal 7 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using a fieldset to group fields

The FIELDSET element is used to group related fields together and can be seen extensively in Drupal forms. While we saw how to inject markup in the previous recipe to group fields from a styling point of view, in this recipe, we will be looking at grouping related fields of the contact form using two separate fieldsets.

Getting ready

We will be using the mysite module created earlier in this book to hold our customizations. As we are altering the contact form, it is assumed that the Contact module is enabled and configured with at least a couple of contact categories via its management page at admin/structure/contact [Home | Administration | Structure | Contact form]. Enabling the module automatically makes a menu ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required