Change select list to radio buttons. 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(&amp;$variables) {
   unset ($variables['form']['Personal Information']['profile_gender']['#description'] );
   .... 
}

In this point when i print_r profile_gender Ive got:

Array ( [#type] =&gt; select [#title] =&gt; Gender [#default_value] =&gt; [#options] =&gt; Array ( [0] =&gt; -- [Select] =&gt; Select [Male] =&gt; Male [Female] =&gt; Female ) [#required] =&gt; 0 [#post] =&gt; Array ( ) [#programmed] =&gt; [#tree] =&gt; [#parents] =&gt; Array ( [0] =&gt; profile_gender ) [#array_parents] =&gt; Array ( [0] =&gt; Personal Information [1] =&gt; profile_gender ) [#weight] =&gt; 0.003 [#processed] =&gt; 1 [#attributes] =&gt; Array ( ) [#input] =&gt; 1 [#size] =&gt; 0 [#multiple] =&gt; [#process] =&gt; Array ( [0] =&gt; form_expand_ahah ) [#name] =&gt; profile_gender [#id] =&gt; edit-profile-gender [#value] =&gt; [#defaults_loaded] =&gt; 1 [#sorted] =&gt; 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'=&gt;t('Male'),'1'=&gt;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)?
The preprocess functions are about rendering the output. Removing and adding form element with FAPI must be done earlier.

You have to do this with hook_form_alter. It's also very likely that you have to add a custom submission handler to process and save the user input. You can hook in your handler in hook_form_alter as well.