Make WordPress Core

Changeset 46103


Ignore:
Timestamp:
09/13/2019 06:29:29 PM (5 years ago)
Author:
adamsilverstein
Message:

Login and Registration: reset password - ensure submit button disabled when field empty.

Fix an issue where the submit button was enabled with an empty password when the user previously checked "Confirm use of weak password" for a weak password, then cleared the password field.

Props henry.wright.
Fixes #47924.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/user-profile.js

    r44895 r46103  
    273273        var pass1 = $('#pass1').val(), strength;
    274274
    275         $('#pass-strength-result').removeClass('short bad good strong');
     275        $('#pass-strength-result').removeClass('short bad good strong empty');
    276276        if ( ! pass1 ) {
    277             $('#pass-strength-result').html( ' ' );
     277            $( '#pass-strength-result' ).addClass( 'empty' ).html( ' ' );
    278278            return;
    279279        }
     
    313313                $weakRow.show();
    314314            } else {
    315                 $submitButtons.prop( 'disabled', false );
     315                if ( $( passStrength ).is( '.empty' ) ) {
     316                    $submitButtons.prop( 'disabled', true );
     317                    $weakCheckbox.prop( 'checked', false );
     318                } else {
     319                    $submitButtons.prop( 'disabled', false );
     320                }
    316321                $weakRow.hide();
    317322            }
Note: See TracChangeset for help on using the changeset viewer.