- examples
Examples demonstrating the Drupal Form API.
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
| Name | Description |
|---|---|
| form_example_element_info | Implements hook_element_info(). |
| form_example_help | Implements hook_help(). |
| form_example_intro | Page callback for our general info page. |
| form_example_menu | Implements hook_menu(). |
| form_example_states_form | This form shows off the #states system by dynamically showing parts of the form based on the state of other parts. |
| form_example_theme | Implements hook_theme(). |
| form_example_tutorial | Main Form tutorial page. |
| form_example_tutorial_1 | This first form function is from the Form Tutorial handbook page |
| form_example_tutorial_10 | Example 10: A form with a file upload field. |
| form_example_tutorial_2 | This is Example 2, a basic form with a submit button. |
| form_example_tutorial_3 | Example 3: A basic form with fieldsets. |
| form_example_tutorial_4 | Example 4: Basic form with required fields. |
| form_example_tutorial_5 | Example 5: Basic form with additional element attributes. |
| form_example_tutorial_7 | Example 7: With a submit handler. |
| form_example_tutorial_8 | Example 8: A simple multistep form with a Next and a Back button. |
| form_example_tutorial_9 | Example 9: A form with a dynamically added new fields. |
| form_example_wizard | The primary formbuilder function for the wizard form. This is the form that you should call with drupal_get_form() from your code, and it will include the rest of the step forms defined. You are not required to change this function, as this will… |
| form_example_wizard_location_info | Returns form elements for the 'location info' page of the wizard. This is the second step of the wizard. This step asks for a textfield value: a City. This step also includes a validation declared later. |
| form_example_wizard_location_info_validate | Custom validation form for the 'location info' page of the wizard. |
| form_example_wizard_next_submit | Submit handler for the 'next' button. |
| form_example_wizard_other_info | Returns form elements for the 'other info' page of the wizard. This is the thid and last step of the example wizard. |
| form_example_wizard_personal_info | Returns form elements for the 'personal info' page of the wizard. This is the first step of the wizard, asking for two textfields: first name and last name. |
| form_example_wizard_previous_submit | Submit handler for the "previous" button. |
| form_example_wizard_submit | Wizard form submit handler. |
| _form_example_steps | Returns the list of steps and their associated forms. This has been separated to clarify and easy the understanding of this example. You should edit this function to include the steps your wizard/multistep form requires. |
File
- form_example/
form_example.module, line 8 - Examples demonstrating the Drupal Form API.