This is a new feature introduced in Magento 2.4.5, but looks like it does not works as expected.
Since Magento 2.4.5, to support Google Recaptcha in the forgot password page, Magento add disabled
HTML attribute to the forgot password button in case you use Google reCaptcha (enabled) and already configured the Google API Key for the reCaptcha.
In theory, if the attribute disabled
HTML attribute is added to the forgot password button, once the customer filled out all required information, the button should be show. But looks like it does not works as expected. If you entered your email and passed reCaptcha but the button still disabled, I think it is bug from Magento code base.
There are some solutions to resolve this issue at this time, you can choose one that fit your need:
- Apply a patch file to remove
disabled
HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml
.
Here you replace:
<button type="submit" class="action submit primary" id="send2" <?php if ($forgotPasswordButtonViewModel->disabled()): ?> disabled="disabled" <?php endif; ?>><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
with
<button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
- Disable
recaptcha_disable_forgot_password_button
plugin file to remove disabled
HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml
.
- Override
vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml
file in your theme or your module to remove disabled
HTML attribute in vendor/magento/module-customer/view/frontend/templates/form/forgotpassword.phtml
.
Here you replace:
<button type="submit" class="action submit primary" id="send2" <?php if ($forgotPasswordButtonViewModel->disabled()): ?> disabled="disabled" <?php endif; ?>><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
with
<button type="submit" class="action submit primary"><span><?= $block->escapeHtml(__('Reset My Password')) ?></span></button>
- Investigate the JS issue and fix it by yourself: investigate why after you filled out all required fields and pass reCaptcha, code does not fire in
dataForm.on('invalid-form.validate'
function which located in vendor/magento/module-customer/view/frontend/web/js/block-submit-on-send.js
and fix the issue.
Related documents: