I want to modify my register page and add some fields from 'profile' content, for example: gender.
So Ive got:
function mysite_preprocess_user_register(&$variables) { unset ($variables['form']['Personal Information']['profile_gender']['#description'] ); .... }
In this point when i print_r profile_gender Ive got:
Array ( [#type] => select [#title] => Gender [#default_value] => [#options] => Array ( [0] => -- [Select] => Select [Male] => Male [Female] => Female ) [#required] => 0 [#post] => Array ( ) [#programmed] => [#tree] => [#parents] => Array ( [0] => profile_gender ) [#array_parents] => Array ( [0] => Personal Information [1] => profile_gender ) [#weight] => 0.003 [#processed] => 1 [#attributes] => Array ( ) [#input] => 1 [#size] => 0 [#multiple] => [#process] => Array ( [0] => form_expand_ahah ) [#name] => profile_gender [#id] => edit-profile-gender [#value] => [#defaults_loaded] => 1 [#sorted] => 1 )
And when I want to change #type to 'radios' displays me nothing..
Like:
$variables['form']['Personal Information']['profile_gender']['#type'] = 'radios';
$variables['form']['Personal Information']['profile_gender']['#options'] = array('0'=>t('Male'),'1'=>t('Female'));
$variables['form']['Personal Information']['profile_gender']['#default_value'] = 'Male';
$variables['gender'] = drupal_render($variables['form']['Personal Information']['profile_gender']);
Any ideas how to change that from select list to radios(male/female)?