WooCommerce的签出字段被浏览器ISSUE误认为是登录字段



在WooCommerce上,我启用了"允许客户在结账时创建帐户",它在结账时添加了UsernamePassword字段,以便客户可以创建帐户。

如果在我的网站上有帐户但已注销的用户使用Chrome进入结账页面,结账时的EmailUsernamePassword字段会自动预先填充用户的现有帐户信息。屏幕截图:https://ibb.co/Db21PTp

同样的问题也发生在Safari上。当我在注销时进入结账页面时,我会立即被引导到Email字段,并被提示使用我现有的帐户信息登录。屏幕截图:https://ibb.co/f9bvXjz

但是在结账时使用现有帐户信息是没有意义的,因为结账时的EmailUsernamePassword字段用于创建新帐户,而不是登录到现有帐户。

我认为需要注意的是,当我登录到我的WordPress帐户时,我总是选中"记住我"复选框,并且我已经将我的网站登录详细信息保存到了这两个浏览器中。

因此,签出页面中的EmailPasswordUsername字段很可能会误导浏览器,使其认为这些字段是登录字段,而事实并非如此。

有没有办法"告诉"浏览器签出时的这些字段不是登录字段

由于大多数专业都删除了autocomplete="false",因此阻止浏览器提示有点棘手。

我注意到他们所有人都有很多不同的行为,现在还没有真正的标准方法来处理这个问题。

所有试图解决该问题的javascript方法都会在移动版本上导致numpad不显示的问题。

不鼓励将-webkit-text-security:disc;与文本<input>组合,因为IE和Firefox不支持这样做。

我已经成功地删除了type="password"并切换到type="text",并使用了不同于密码或登录名或任何其他同义词的名称属性。(例如:pw_9394792lg_9394792(。与color:transparent;text-shadow:black 0 0 10px;相结合,可直观地隐藏密码。

<input type="text" name="lg_9394792">
<input type="text" name="pw_9394792" style="color:transparent;text-shadow:black 0 0 10px;">

不久前,我还尝试过在页面顶部设置一个虚拟表单。

<form style="height:0;max-height:0;background:transparent;color:transparent;border:none;" data-description="dummy">
<input type="email" style="height:0;max-height:0;background:transparent;color:transparent;border:none;" data-description="email"></input>
<input type="text" style="height:0;max-height:0;background:transparent;color:transparent;border:none;" data-description="username"></input>
<input type="password" style="height:0;max-height:0;background:transparent;color:transparent;border:none;" data-description="password"></input>
<input type="submit" style="height:0;max-height:0;background:transparent;color:transparent;border:none;" data-description="submit">
</form>

Github上有一个非常流行的关于它的帖子已经持续了近3年,请参阅@https://gist.github.com/niksumeiko/360164708c3b326bd1c8.

最新更新