2. FormAPI Intro
Forms are defined by a single php array. Each key of
the array is a form element.
Drupal builds and generates the html output for the
form using this FormAPI.
3. Why a FormAPI?
Provide a standardized means to create, process, and
theme forms.
Provides safe form error handling and validation.
Allow other code (modules) to modify forms.
4. Building a form
Step 1: Define a new function that builds and returns a
form array.
Step 2 (optional): Define a function that validates the
form values.
Step 3: Define a function that process the form values
on submit.
Step 4: Call the form function using drupal_get_form()
to present the form on a page.