In Drupal 6, we could use PHP to set default values, but the same code cannot be used with Drupal 7.
I am trying to do this through hook_form_alter()
, but the code doesn't work.
function my_form_alter(&$form, &$form_state, $form_id) {
dsm($form);
switch($form_id) {
case 'accounts_node_form':
$form["field_accounts"]["und"]['#default_value'] = $default;
// …
break;
}
}