Use email as username, remove input for username.

Skip to first unread message

Jun Wei Neo

Sep 21, 2021, 4:09:30 AM9/21/21
to Joomla! General Development
I have a registration form that looks like this But I would like to remove the username and name field in the form so that the user will only register using their email and password.

What I am trying to achieve?
- User will register via their email address and password instead of username and password.
- User will login via their email address and password instead of username and password.

What steps did I take:
I went to the registration.xml file (attached as registration.xml) that is responsible for the form display and
commented out the name and username field.

Problems I faced:
After commenting out the name and username field in the registration.xml file, I would get an error when
registering. Image of the error is in the link below:

* I have also attached the register function code in registration.txt file. The Register() function is
under RegistrationController that was created by Joomla.

Benjamin Trenkle

Sep 27, 2021, 8:12:47 PM9/27/21
to Joomla! General Development
several things you should consider:
- you need a (user) plugin, to change the form fields in a clean way ($form->removeField)
- Joomla! can't go without an username, so you need the plugin to set this data from the email (use 
- You need overrides to clean out the not used fields.
Reply all
Reply to author
0 new messages