How do you change the default value on a CCK text field that is part of a field group via hook_form_alter()? I'm trying to programmatically set the default value (#default_value) on a textfield added via CCK. This field is in a field group. Here is my code:

/**
 * Implements hook_form_id_form_alter().
 */
function EXAMPLE_form_profile_node_form_alter(&amp;$form, $form_state) {
  // We need to jump into a CCK field, so say we all.
  $form['#after_build'][] = 'EXAMPLE_form_profile_node_form_after_build';
}

function EXAMPLE_form_profile_node_form_after_build($form, &amp;$form_state) {
  $form['group_company_profile']['field_pro_name']['#default_value'][0]['value'] = t('test');

  return $form;
}


I've tried various other points in the array and nothing seems to work. Both CCK and my module are weight 0. I must be missing something super obvious...?

UPDATE: One mistake was the field name. It should be field_pro_name. Updated above. It's still not working. Interestingly, I can use the after build to change the field title with:

$form['group_company_profile']['field_pro_name'][0]['value']['#title'] = 'ttt';


However, none of these changes the default value:

// In form alter:
$form['group_company_profile']['field_pro_name'][0]['#default_value']['value'] = 'ttt';
$form['group_company_profile']['field_pro_name'][0]['value']['#default_value'] = 'ttt';

// In after build:
$form['group_company_profile']['field_pro_name'][0]['value']['#default_value'] = 'ttt';
$form['group_company_profile']['field_pro_name'][0]['#default_value']['value'] = 'ttt';
You should be able to do something like this:

function EXAMPLE_form_alter(&amp;$form, &amp;$form_state, $form_id) {

  if ($form_id=='profile_node_form') {
    $form['group_company_profile']['field_pro_type'][0]['#default_value']['value'] = 'hello world';
  }

  // all other form alters here...

}


or

function EXAMPLE_form_profile_node_form_alter(&amp;$form, &amp;$form_state) {

  $form['group_company_profile']['field_pro_type'][0]['#default_value']['value'] = 'hello world';

}


directly from whichever form_alter() style you like.