Form Panel: Easily Rearrange Input Form Elements

The Form Panel module provides two theme functions which, in turn, provide an easy way to put multiple input form elements on the same line. At the most basic level, it can turn this:

  First Name:
  [textfield]
  
  Last Name:
  [textfield]

  Address:
  [textfield]

  City:
  [textfield]

  State:
  [select list]

into this:

  First Name:  Last Name:
  [textfield]  [textfield]

  Address:
  [textfield]

  City:        State:
  [textfield]  [select list]

It can do this using either an HTML table or <div> tags. In both cases, it includes various CSS classes to help with styling.

It is important to note, however, that this module does nothing on its own. You must refer to one of the included themes from PHP code in order for there to be any effect.

1. The Two Themes

The theme named form_panel_table provides a table-based output. The theme named form_panel_div wraps each row in a tag with a specific

2. Positioning

This module uses a grid-based approach to describe where to put form elements. Rows and columns are numbered starting with 1, not 0, however

3. Omitting Rows/Columns

When a table is generated using the form_panel_table theme, missing rows and columns will be merged. This means that appropriate rowspan

4. Reuse of Cells

It is possible to have more than one form element appear in the same table cell or tag, simply by assigning them the same weight. When form

5. CSS Considerations

If you are using form_panel_div, you will most likely want to create a class for your inner divs that sets them to "display: inline".

6. More Attributes

The two themes also accept a number of other optional parameters, which change the appearance of the final output.

Guide maintainers

gribnif's picture