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

Form constructor for disabled html_date and html_time elements.

See also

form_test_no_access_h5date_h5time_submit()

File

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

Code

function form_test_no_access_h5date_h5time($form, &$form_state) {
  $form['no_access_h5date'] = array(
    '#type' => 'html_date',
    '#title' => 'Date',
    '#description' => 'A date.',
    '#default_value' => array(
      'date' => '2023-01-01',
    ),
    '#access' => FALSE,
  );
  $form['no_access_h5time'] = array(
    '#type' => 'html_time',
    '#title' => 'Time',
    '#description' => 'A time.',
    '#default_value' => array(
      'time' => '20:30',
    ),
    '#access' => FALSE,
  );
  $form['disabled_h5date'] = array(
    '#type' => 'html_date',
    '#title' => 'Date',
    '#description' => 'A date.',
    '#default_value' => array(
      'date' => '2023-01-01',
    ),
    '#disabled' => TRUE,
  );
  $form['disabled_h5time'] = array(
    '#type' => 'html_time',
    '#title' => 'Time',
    '#description' => 'A time.',
    '#default_value' => array(
      'time' => '20:30',
    ),
    '#disabled' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Submit',
  );
  return $form;
}