0
Password confirmation not working, code is given below

<div id="password-div" style="display:none">
                                    <div class="field password required">
                                        <label for="password" class="label"><span><?= $block->escapeHtml(__('Password')) ?></span></label>
                                        <div class="control">
                                            <input type="password" name="password" id="password"
                                                title="<?= $block->escapeHtmlAttr(__('Password')) ?>"
                                                class="input-text"
                                                data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
                                                data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
                                                data-validate="{required:true, 'validate-customer-password':true}"
                                                autocomplete="off" style="width:550px;">
                                            <div id="password-strength-meter-container" data-role="password-strength-meter" aria-live="polite">
                                                <div id="password-strength-meter" class="password-strength-meter">
                                                    <?= $block->escapeHtml(__('Password Strength')) ?>:
                                                    <span id="password-strength-meter-label" data-role="password-strength-meter-label">
                                                        <?= $block->escapeHtml(__('No Password')) ?>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <div id="crm-password-div" style="display:none">    
                                    <div class="field confirmation required">
                                        <label for="password-confirmation" class="label"><span><?= $block->escapeHtml(__('Confirm Password')) ?></span></label>
                                        <div class="control">
                                            <input type="password" name="password_confirmation" title="<?= $block->escapeHtmlAttr(__('Confirm Password')) ?>" id="password-confirmation" class="input-text" data-validate="{required:true,'validate-customer-password':true, equalTo:'#password'}" autocomplete="off" style="width:550px;">
                                        </div>
                                    </div>
                                </div>                            
0

Try This :-

<div class="field password required" data-mage-init='{"passwordStrengthIndicator": {}}'>
    <label class="label" for="password"><span><?= $block->escapeHtml(__('New Password')) ?></span></label>
    <div class="control">
        <input type="password" class="input-text" name="password" id="password"
               data-password-min-length="<?= $block->escapeHtmlAttr($block->getMinimumPasswordLength()) ?>"
               data-password-min-character-sets="<?= $block->escapeHtmlAttr($block->getRequiredCharacterClassesNumber()) ?>"
               data-validate="{required:true, 'validate-customer-password':true}"
               autocomplete="off">
        <div id="password-strength-meter-container" data-role="password-strength-meter" aria-live="polite">
            <div id="password-strength-meter" class="password-strength-meter">
                <?= $block->escapeHtml(__('Password Strength')) ?>:
                <span id="password-strength-meter-label" data-role="password-strength-meter-label">
                    <?= $block->escapeHtml(__('No Password')) ?>
                </span>
            </div>
        </div>
    </div>
</div>
<div class="field confirmation required">
    <label class="label" for="password-confirmation"><span><?= $block->escapeHtml(__('Confirm New Password')) ?></span></label>
    <div class="control">
        <input type="password" class="input-text" name="password_confirmation" id="password-confirmation" data-validate="{required:true,equalTo:'#password'}" autocomplete="off">
    </div>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.