example_form

6 example.profile example_form(&$form_state, $url)
7 example.profile example_form(&$form_state, $url)
8 example.profile example_form(&$form_state, $url)

Form API array definition for the example form.

1 string reference to 'example_form'

File

developer/example.profile, line 273

Code

function example_form(&$form_state, $url) {

  // This is just a very simple form with one textfield, and a
  // submit button.
  $form['example_text'] = array(
    '#type' => 'textfield', 
    '#title' => st('Testing text'), 
    '#default_value' => '', 
    '#size' => 45, 
    '#maxlength' => 45, 
    '#required' => TRUE, 
    '#description' => st('This is an example form demonstrating forms usage in the installer profiles tasks. Enter any text to see what happens.'),
  );

  $form['continue'] = array(
    '#type' => 'submit', 
    '#value' => st('Continue'),
  );

  // Note that #action is set to the url passed through from
  // installer, ensuring that it points to the same page, and
  // #redirect is FALSE to avoid broken installer workflow.
  $form['errors'] = array();
  $form['#action'] = $url;
  $form['#redirect'] = FALSE;

  return $form;
}
Login or register to post comments