function form_test_required_attribute

Builds a form to test the required attribute.

1 string reference to 'form_test_required_attribute'
form_test_menu in drupal/core/modules/system/tests/modules/form_test/form_test.module
Implements hook_menu().

File

drupal/core/modules/system/tests/modules/form_test/form_test.module, line 2337
Helper module for the form API tests.

Code

function form_test_required_attribute($form, &$form_state) {
  foreach (array(
    'textfield',
    'textarea',
    'password',
  ) as $type) {
    $form[$type] = array(
      '#type' => $type,
      '#required' => TRUE,
      '#title' => $type,
    );
  }
  return $form;
}