Closed (fixed)
Project:
User Read-Only
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Mar 2008 at 20:46 UTC
Updated:
27 Jun 2008 at 20:23 UTC
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
Comment #1
deekayen commentedComment #2
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.