1 form_test.module form_test_autocomplete($form, &$form_state)

Form constructor for testing autocomplete elements.

Related topics

File

core/modules/simpletest/tests/form_test.module, line 1970
Helper module for the Form API tests.

Code

function form_test_autocomplete($form, &$form_state) {
  foreach (array('textfield', 'email', 'search', 'tel', 'url') as $type) {
    $form['user_' . $type] = array(
      '#type' => $type,
      '#title' => 'User autocomplete ' . $type,
      '#autocomplete_path' => 'user/autocomplete',
    );
  }
  $form['node_textfield'] = array(
    '#type' => 'textfield',
    '#title' => 'Node autocomplete textfield',
    '#autocomplete_path' => 'node/autocomplete',
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  return $form;
}