function form_example_tutorial_2

This is Example 2, a basic form with a submit button.

See also

http://drupal.org/node/717726

Related topics

1 string reference to 'form_example_tutorial_2'
form_example_menu in form_example/form_example.module
Implements hook_menu().

File

form_example/form_example_tutorial.inc, line 69

Code

function form_example_tutorial_2($form, &$form_state) {
    $form['description'] = array(
        '#type' => 'item',
        '#title' => t('A simple form with a submit button'),
    );
    $form['name'] = array(
        '#type' => 'textfield',
        '#title' => t('Name'),
    );
    // Adds a simple submit button that refreshes the form and clears its
    // contents. This is the default behavior for forms.
    $form['submit'] = array(
        '#type' => 'submit',
        '#value' => 'Submit',
    );
    return $form;
}