Introduction
Forms are an integral part of just about every site and Drupal provides a powerful interface to create and manipulate them through its Form API. The API abstracts the process of creating and managing complex forms, and standardizes the process with implicit importance placed upon security and reusability.
All said, however, the singular benefit of the Form API is the ability for Drupal modules and themes to alter and customize forms at will. It could well be argued that this API is Drupal's most powerful feature.
The Form API can be a complex beast to understand in its entirety. However, from the point of view of a themer, our focus will rest solely on the process through which forms in Drupal are constructed and displayed. Keeping this in mind, forms are rendered by running through the following broad steps:
Create elements: The Form API and contributed modules create and expose form elements for use by modules. These elements can include basic fields such as textfields, checkboxes...