Set default value radio button in template I'm trying to set a default value in a template file for a radio button on my register form.

Female has value 0 and male has value 1. This is the code I use to set a default value:

    $form['field_personal_details']['und'][0]['field_gender']['und']['#default_value'] = '1';


I also tried

    $form['field_personal_details']['und'][0]['field_gender']['und']['#value'] = '1';


This should check the radio button as male, but it doesn't work.
Whenever I set the default value to male through the UI it does work and I get the same outputs when I do a dpm. 

What am I doing wrong?
Add direct user registration form alter and try to change "1" to 1.

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

  $form['field_gender']['und']['#default_value'] = 1;
    &lt;---or ---&gt; 
  $form['field_personal_details']['und'][0]['field_gender']['und']['#default_value'] = 1;

}