How Forms Work in Drupal
With Drupal 5, the approach to form handling continues to evolve. Drupal forms are tightly integrated into the core, and as a result, theming them can be a bit of a chore. Unlike other areas of the system, most forms are not the subject of a variety of pre-existing themeable functions. Instead, if you wish to theme a form you are typically left with the choice of either working directly with the form functions in the Drupal core or with following the well-trodden path of intercepting and overriding the form output using the power of the PHPTemplate template engine.
While themeable functions are pretty easy to deal with—being essentially concerned with the formatting of output—the Drupal form functions tend to be rather complicated. Finding the proper bit to modify and then accomplishing that without unintended side effects requires either a solid knowledge of PHP or a willingness to experiment, combined with a great deal of patience.
While you will note that a number...