theming username field in user-register form i'm trying to theming my user register form. i would like to have a custom function for the username part. So, i'm doing

$form['account']['name']['#theme'] = 'my_custom';


i define my hook_theme and just for testing purpouses, this is my custom function

function theme_my_custom( $variables ){
  return 'testing code...'
}


My problem is when i go to user/register, i still can see the label for my username. Only the input is replaced by the code of my function. I would expect replace the element entirely, but this is not happening.

Any clues? Thanks.
As you can see on the Form API reference page, '#theme' Only affects the input box itself. To remove other things generated by the form API, you'll have to clear the array -

$form['account']['name']['#title'] =&gt; '';
$form['account']['name']['#description'] =&gt; '';


or just

$form['account']['name'] = array(...);


To reset existing elements.