Hi guys,
on my Joomla I'm looking for to use the Email as Username during Registration / Login (something likewise it is yet happening during the JFBConnect Social Registration).
The goal is:
Register - creating / editing
- to live auto populate / auto fill the "username" field with the value of that "email" when typing (something like onKeyup) and before saving > Something like: when typing email1 fill in the hidden username
- hiding the "username" field that could be done also through Custom CSS
Login
- with simple Language Overrides will manually change the "Username" label with "Email" (the same will be for emails and alerts)
I found this solution that is a real simple trick that can really solve all compatibility without any joomla hack, I'm just adding this code into the template Custom JavaScript, in action
on this test site
:
jQuery(document).ready(function($){
$('#jform_username').closest(".control-group,.form-group").hide().addClass("hide");
$('#jform_email1').keyup(function(){
$('#jform_username').val($('#jform_email1').val()).keyup();
});
});
The question is:
1 - Could it interfere with the JFBConnect Social registration?
2 - As far as I now, for performance, would be better to have it in Vanilla.js instead of jQuery, Am I right ? Maybe, Can you help on it ?
All suggestion / help / corrections etc. are welcome, thanks!