form_example_tutorial.inc

Version 1.10 (checked in on 2010/12/26 at 21:45:54 by ilo)

This is the Form API Tutorial from the handbook. TODO: Update this URL, and update it in the dynamic text below.

See also

http://drupal.org/node/262422

It goes through nine form examples in increasing complexity to demonstrate Drupal 7 Form API.

Links are provided inline for the related handbook pages.

Functions & methods

NameDescription
form_example_tutorialMain Form tutorial page.
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_10_submitSubmit handler for form_example_tutorial_10().
form_example_tutorial_10_validateValidate handler for form_example_tutorial_10().
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_6Example 6: A basic form with a validate handler.
form_example_tutorial_6_validateNow we add a handler/function to validate the data entered into the "year of birth" field to make sure it's between the values of 1900 and 2000. If not, it displays an error. The value report is $form_state['values'] (see…
form_example_tutorial_7Example 7: With a submit handler.
form_example_tutorial_7_submitSubmit function for form_example_tutorial_7().
form_example_tutorial_7_validateValidation function for form_example_tutorial_7().
form_example_tutorial_8Example 8: A simple multistep form with a Next and a Back button.
form_example_tutorial_8_next_submitSubmit handler for form_example_tutorial_8() next button.
form_example_tutorial_8_next_validateValidate handler for the next button on first page.
form_example_tutorial_8_page_twoReturns the form for the second page of form_example_tutorial_8().
form_example_tutorial_8_page_two_backBack button handler submit handler.
form_example_tutorial_8_page_two_submitThe page 2 submit handler.
form_example_tutorial_9Example 9: A form with a dynamically added new fields.
form_example_tutorial_9_add_nameSubmit handler for "Add another name" button on form_example_tutorial_9().
form_example_tutorial_9_remove_name
form_example_tutorial_9_submitSubmit function for form_example_tutorial_9().
form_example_tutorial_9_validateValidate function for form_example_tutorial_9().