Examples: Form Examples

The Form Example module is a part of the Examples for Developers Project and provides various Drupal Form API Examples. You can download and experiment with this code at the Examples for Developers project page.

Functions & methods

NameDescription
form_example_states_formThis form shows off the #states system by dynamically showing parts of the form based on the state of other parts.
form_example_tutorial_1This first form function is from the Form Tutorial handbook page
form_example_tutorial_10Example 10: A form with a file upload field.
form_example_tutorial_2This is Example 2, a basic form with a submit button.
form_example_tutorial_3Example 3: A basic form with fieldsets.
form_example_tutorial_4Example 4: Basic form with required fields.
form_example_tutorial_5Example 5: Basic form with additional element attributes.
form_example_tutorial_7Example 7: With a submit handler.
form_example_tutorial_8Example 8: A simple multistep form with a Next and a Back button.
form_example_tutorial_9Example 9: A form with a dynamically added new fields.

examples/form_example/form_example.module, line 10