FIX: Password field check

This commit is contained in:
Tony Air 2024-01-26 17:34:29 +02:00
parent c712b2b93e
commit c351cb73f8

View File

@ -23,7 +23,7 @@ class SiteMemberLoginForm extends MemberLoginForm
$fields = $this->Fields();
$actions = $this->Actions();
Requirements::customScript('document.querySelector(".field-password__show-password").addEventListener("click",function(e){e.preventDefault();var p = document.querySelector(\'[name="Password"]\');if(p.getAttribute("type")==="password"){var attr="text";}else{var attr="password"}p.setAttribute("type", attr);});');
Requirements::customScript('const pwd = document.querySelector(".field-password__show-password");if(pwd){pwd.addEventListener("click",function(e){e.preventDefault();var p = document.querySelector(\'[name="Password"]\');if(p.getAttribute("type")==="password"){var attr="text";}else{var attr="password"}p.setAttribute("type", attr);});}');
$email = $fields->fieldByName('Email');
if ($email) {
$email