Drupal how to disable a form element in a cck form using form alter
Related content
- How to obscure email and other text using signwriter and a cck formatter
- Gettting the labels for a cck field
- Think twice when defining a new content type
- Drupal how to render seperate fieldgroups from a content type (and a display suite trick)
- Drupal how to add another formatter to a cck field using hook_field_formatter_info
- Drupal how to load content fields using cck content api avoiding node load
- Drupal module Fancy Multiselect


Deletes default values
First off, thank you for this code. Worked great for disabling.
However, I have my cck fields set to a default value. And when I used this snippet, the default values were erased once I clicked the save button. Is there any lines i could add to this to have it save the default values that I had set in drupal?
Thanks again for your help.
Milan
I believe when a form field
I believe when a form field is disabled no values are submitted, this is rather a html related issue than a form api/drupal related issue http://stackoverflow.com/questions/1191113/disable-select-form-field-but...
OK
Well that makes sense. Thank you for the response, Dominique!
replace
replace $elements['#attributes']['disabled'] = 'disabled' with this $elements['#attributes']['readonly'] = 'readonly' to save default value.