1 theming_example.module theming_example_text_form($form, &$form_state)

A simple form that displays a textfield and submit button.

This form will be rendered by theme('form') (theme_form() by default) because we do not provide a theme function for it here.

Related topics

File

modules/examples/theming_example/theming_example.module, line 240
Hook implementations for the Theming Example module.

Code

function theming_example_text_form($form, &$form_state) {
  $form['text'] = array(
    '#type' => 'textfield',
    '#title' => t('Please input something!'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Go'),
  );
  return $form;
}