This example demonstrates how to use the form API.

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

Parent topics

File

modules/examples/form_example/form_example.module, line 7
Hook implementations for the Form Example module.

Functions

Namesort descending Location Description
form_example_config_info modules/examples/form_example/form_example.module Implements hook_config_info().
form_example_element_info modules/examples/form_example/form_example.module Implements hook_element_info().
form_example_intro modules/examples/form_example/form_example.module Page callback for our general info page.
form_example_menu modules/examples/form_example/form_example.module Implements hook_menu().
form_example_states_form modules/examples/form_example/form_example_states.inc States demo form.
form_example_theme modules/examples/form_example/form_example.module Implements hook_theme().
form_example_tutorial modules/examples/form_example/form_example_tutorial.inc Main Form tutorial page.
form_example_tutorial_1 modules/examples/form_example/form_example_tutorial.inc This is Example 1, a very basic form with a textfield.
form_example_tutorial_10 modules/examples/form_example/form_example_tutorial.inc This is Example 10: a form with a file upload field.
form_example_tutorial_2 modules/examples/form_example/form_example_tutorial.inc This is Example 2, a basic form with a submit button.
form_example_tutorial_3 modules/examples/form_example/form_example_tutorial.inc This is Example 3: a basic form with fieldsets.
form_example_tutorial_4 modules/examples/form_example/form_example_tutorial.inc This is Example 4: a basic form with required fields.
form_example_tutorial_5 modules/examples/form_example/form_example_tutorial.inc This is Example 5: a basic form with additional element attributes.
form_example_tutorial_7 modules/examples/form_example/form_example_tutorial.inc This is Example 7: a form with a submission handler.
form_example_tutorial_8 modules/examples/form_example/form_example_tutorial.inc This is Example 8: a simple multistep form with a Next and a Back buttons.
form_example_tutorial_9 modules/examples/form_example/form_example_tutorial.inc This is Example 9: a form with new fields dynamically added.
form_example_wizard modules/examples/form_example/form_example_wizard.inc The primary formbuilder function for the wizard form.
form_example_wizard_location_info modules/examples/form_example/form_example_wizard.inc Returns form elements for the 'location info' page of the wizard.
form_example_wizard_location_info_validate modules/examples/form_example/form_example_wizard.inc Custom validation form for the 'location info' page of the wizard.
form_example_wizard_next_submit modules/examples/form_example/form_example_wizard.inc Submit handler for the 'next' button.
form_example_wizard_other_info modules/examples/form_example/form_example_wizard.inc Returns form elements for the 'other info' page of the wizard.
form_example_wizard_personal_info modules/examples/form_example/form_example_wizard.inc Returns form elements for the 'personal info' page of the wizard.
form_example_wizard_previous_submit modules/examples/form_example/form_example_wizard.inc Submit handler for the "previous" button.
form_example_wizard_submit modules/examples/form_example/form_example_wizard.inc Wizard form submit handler.
_form_example_steps modules/examples/form_example/form_example_wizard.inc Returns the list of steps and their associated forms.

Classes

Namesort descending Location Description
FormExampleTestCase modules/examples/form_example/tests/form_example.test Default test case for the form_example module.