You are here

function entity_autocomplete_test_form in Entity Autocomplete 7

Form builder; test form for Entity Autocomplete FAPI element().

See also

entity_autocomplete_test_form_submit()

1 string reference to 'entity_autocomplete_test_form'
entity_autocomplete_test_menu in tests/entity_autocomplete_test.module
Implements hook_menu().

File

tests/entity_autocomplete_test.module, line 39
Dummy module implementing a form to test Entity Autocomplete form element.

Code

function entity_autocomplete_test_form($form, &$form_state, $entity_type, $bundles, $default_value = NULL) {
  $form['entity_autocomplete'] = array(
    '#type' => 'entity_autocomplete',
    '#title' => t('Entity Autocomplete test field'),
    '#entity_type' => $entity_type,
    '#bundles' => $bundles,
    '#default_value' => $default_value,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Test'),
  );
  return $form;
}