Skip to Content Skip to Menu

🏖 Mid-Summer sale is here! Get 20% off professional and developer memberships with code SUMMER-2026!

username/email field has incorrect type when Login Method: Email

1 month 2 weeks ago #344087 by BobBriscoe
If you agree, could you file a feature ticket to alter the HTML attributes of the combined username/email field when CB is configured for Login Method: Email.
The HTML attributes should be:
  • type="email" (not "text"
  • autocomplete="email" (not "username").
  • You might want to consider adding inputmode="email" as well.
Without these, a smartphone doesn't select its email-specific soft keyboard for completing the field, and it doesn't autocomplete the email address.

For my own site, I can edit my template override. But this is a request to fix the more general 'bug' at source.
 

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50612
  • Thanks: 8671
  • Karma: 1474
1 month 2 weeks ago #344089 by krileon
Changing autocomplete="username" would break password managers autofill. It tells password managers that's a login username. autocomplete="email" is typically for non-login forms like registration, newsletters, etc.. inputmode is only needed it the type remains as type="text". type="email" should be sufficient enough to show the proper selector on mobile though and have added a feature ticket for that.

forge.joomlapolis.com/issues/9875


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago - 1 month 2 weeks ago #344092 by BobBriscoe
Thx. I'll leave autocomplete="username".

For your convenience, by experimentation, I believe the value of $showUsernameLabel is 5 for the Email Login Method. So the relevant single change to mod_cblogin/xxx.php would be in the following if block (I've tested this in bootstrap_j4.php and it works on iPhone-Safari and Android-Chrome):
Code:
                            <?php if ( $showUsernameLabel != 3 ) { ?>                                 <label for="modlgn-username-<?php echo $module->id; ?>" class="visually-hidden"><?php echo htmlspecialchars( $userNameText ); ?></label>                             <?php } ?>                             <input id="modlgn-username-<?php echo $module->id; ?>" type="email" name="username" class="<?php echo ( $styleUsername ? htmlspecialchars( $styleUsername ) : 'form-control' ); ?>" size="<?php echo $usernameInputLength; ?>" autocomplete="username"<?php echo ( in_array( $showUsernameLabel, array( 4, 5 ) ) ? ' placeholder="' . htmlspecialchars( $userNameText ) . '"' : null ); ?>>

 
Last edit: 1 month 2 weeks ago by BobBriscoe. Reason: Rendered colour within code as confusing tags, so removed

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum