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?