If the scope is to hide a date control from a form then try this ...
It has the same attitude.

ref. http://api.drupal.org/api/file/developer/topics/forms_api_reference.html

        switch ($form[$group][$key]['#type']) {
          case 'date':
            $form[$group]['user_readonly'][$key] = $form[$group][$key];
            $form[$group]['user_readonly'][$key]['#type'] = 'item';
            $form[$group]['user_readonly'][$key]['#description'] = '';
            $form[$group]['user_readonly'][$key]['#title'] = '';
            $form[$group][$key]['#attributes']['disabled'] = TRUE;
            break;
          case 'password_confirm':
            // due to the complex nature of these fields,
            // we simply delete them from the form.
            unset($form[$group][$key]);
            break;
          default:
            // fields must have a hidden field w/ proper value.
            // as disabled fields are not submitted.
            $form[$group]['user_readonly'][$key] = $form[$group][$key];
            $form[$group]['user_readonly'][$key]['#type'] = 'hidden';
            $form[$group][$key]['#attributes']['disabled'] = TRUE;
            break;
        }

Comments

deekayen’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.