#value or #default_value missing from field in $form array I made a custom content type with a couple of fields. If i go to node/add/custom-content-type
I have a dsm of $form in my .module file which shows the array in a krumo just fine. In the krumo the array shows the custom fields made in field UI, and each field has an array of 6 elements. Here's where the key #value and #default_value are missing.

Instead, the 6 keys are:

#type (String, 9 characters ) container
#attributes (Array, 1 element)
#weight (String, 1 characters ) 1
#tree (Boolean) TRUE
#language (String, 3 characters ) und
und (Array, 13 elements)


So obviously the question is how do I get those keys/attributes of that field in that array?
See Why is hook_form_alter() so messy? for a bit of background, but basically you need to drill further down into the array.

Assuming it's a standard text field you would set, for example, the default value like so:

$form['field_name'][LANGUAGE_NONE][0]['value']['#default_value'] = 'foo';