Drupal 6.x

Comprehensive documentation of the Forms API in a single location does not currently exist. While the Forms API is documented, you will be forced to piece together how it all works from various documents. In the meantime, feel free to help out by contributing new documentation, clarifying existing documentation and posting comments in this section.

Key documents you'll want to consult if you want to learn Forms API for Drupal 6

Beginners and intermediate users should consult:

Intermediate and advanced users can make use of:

Below in an outline meant as a step toward develop comprehensive documentation

  1. Overview
  2. Form creation
    1. Overview
    2. Building individual fields
      1. Example
      2. Declaring field names
        1. Nesting
        2. Tree attribute
      3. Declaring properties/attributes
        1. Link to list of all properties/attributes available
    3. Building form groups
      1. Overview
      2. Example
      3. Fieldset attribute
      4. Collapsible form groups
    4. Declaring markup
      1. Prefix/Suffix
        1. Example
      2. Markup attribute
        1. Example
    5. Weighting elements/groups
      1. Overview
      2. Example
    6. Returning forms
      1. drupal_get_form()
        1. When to use drupal_get_form
        2. Example
      2. Returning form elements
        1. When to return form elements
        2. Example
  3. Theming Forms
    1. Overview
      1. When to use form markup
      2. When to use separate theming function
    2. Example
    3. form_render()
      1. Rendering individual elements
      2. Final render
    4. Looping through the $form array
      1. Using element_children
    5. Theming individual form elements
    6. Theming form elements in a table
      1. Building the rows
  4. Validating forms
    1. Overview
    2. Example
  5. Executing forms
    1. Overview
    2. Example
    3. Converting from the POST/switch approach
    4. confirm_form()
      1. Overview
      2. Example
  6. Overriding Forms – this section needs work. No code has been written for these features as yet AFAIK
    1. Altering form elements
      1. Overview
      2. Example
    2. Custom theming
      1. Overview
      2. Example
    3. Custom validation
      1. Overview
      2. Example
    4. Custom execution
      1. Overview
      2. Example
 
 

Drupal is a registered trademark of Dries Buytaert.