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

Form constructor for testing #type 'url' elements.

See also

form_test_url_submit()

Related topics

File

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

Code

function form_test_url($form, &$form_state) {
  $form['url'] = array(
    '#type' => 'url',
    '#title' => 'Optional URL',
    '#description' => 'An optional URL field.',
  );
  $form['url_required'] = array(
    '#type' => 'url',
    '#title' => 'Required URL',
    '#description' => 'A required URL field.',
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  return $form;
}