Custom Register Form - Show/hide password on password fields?

Support MB User Meta Custom Register Form - Show/hide password on password fields?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #44216
    CodogCodog
    Participant

    Hi there,
    I have created a custom Registration Form using your 'rwmb_profile_register_fields' filter hook and all works well. I have added the password fields like so...

    
    .....			
                    'password'  => [
                    'name'     => __( 'Password', 'text-domain' ),
                    'id'       => 'user_pass',
                    'type'     => 'password',
                    'required' => true,
                    'desc'     => '<span id="password-strength" class="rwmb-password-strength"></span>',
                    'attributes' => [
                        'autocomplete' => 'new-password'
                    ]
                ],
                'password2' => [
                    'name'     => __( 'Confirm Password', 'text-domain' ),
                    'id'       => 'user_pass2',
                    'type'     => 'password',
                    'required' => true,
                ],
    .....
    

    However, when adding these password fields the "Show/Hide" password "eye icon" is no longer available to the user? Is there an attribute or method to keep this functionality on these fields when creating a custom registration form?

    Many thanks 🙂

    #44219
    PeterPeter
    Moderator

    Hello,

    Please try to add the setting 'append' => '<i class="password-icon show-icon"></i>', to the password field to display the show/hide icon.

    'password2' => [
    	'name'     => __( 'Confirm Password', 'mb-user-profile' ),
    	'id'       => 'user_pass2',
    	'type'     => 'password',
    	'required' => true,
    	'append'   => '<i class="password-icon show-icon"></i>', //here
    ]
    #44220
    CodogCodog
    Participant

    Hi peter,
    thanks for the prompt response.

    That worked perfectly 🙂

    Final Question (Regarding password field)
    ===========================================

    Is there any way to 'Remove' the 'confirm password' field (user_pass2) but still maintain the strength password meter functionality in the primary password field (user_pass). It does not seem to function once the 'confirm password' is removed?

    Thanks 🙂

    #44226
    PeterPeter
    Moderator

    Hello,

    It isn't possible. You need to keep the field user_pass2 to make the check password strength function work properly.

    #44229
    CodogCodog
    Participant

    Hi Peter,
    thanks for your response.

    It would be really great to have the option to turn off the confirmation password - In UXD forcing users to confirm their password has been known to reduce registration conversion rates significantly!

    Could this be considered as a future improvement?

    Thanks 🙂

    #44235
    PeterPeter
    Moderator

    Hello,

    I will inform the development team to consider supporting this case in future updates.

    Thank you.

    #44236
    CodogCodog
    Participant

    Thanks Peter 🙂

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.