I just installed and configured the logintoboggan module; I created extra fields and they are displayed just fine. I can't remember how to disable the drupal default username field on the registration form.
Can anyone assist me?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityTo disable a field in a form you must use hook_form_alter() like
MYMODULE_form_alter($form, $form_state, $form_id) {
if ($form_id == 'user_register_form' ) { // id of registration form
$form['account']['name']['#access'] = FALSE;
}
}
#access
Used by: All elements and forms
Description: Whether the element is accessible or not; when FALSE, the element is not rendered and the user submitted value is not taken into consideration.
I would also like to mention for other people reading this that this can also be accomplished with the email_registration module