【发布时间】:2016-09-08 16:20:00
【问题描述】:
我的网站有一个登录表单,其中包含电子邮件地址和密码字段。这工作正常,我测试过的所有浏览器都正确地自动填充字段。
我最近在表单中添加了一个复选框输入,Chrome 浏览器(版本 50.0.2661.94)不再自动填充密码字段。输入的自动完成属性根据html spec 设置。 Chrome 实际上会询问我是否要保存网站密码,但仍不会自动填充。
作为一项实验,我尝试将复选框的输入类型更改为“文本”和其他类型,然后自动填充按预期工作。添加复选框后,Safari 和 Firefox 仍会自动填充。
不幸的是,我似乎无法在 jsfiddle 中复制这种行为,但希望有人能指出我错过的一些东西。这是我的表单的精简版:
<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.3/semantic.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.3/semantic.min.js"></script>
</head>
<body>
<form class="ui form" method="post" action="login">
<input name="email" type="email" autocomplete="email" placeholder="Email" class="email-input">
<input name="password" type="password" autocomplete="current-password" placeholder="Password" class="password-input">
<input name="sharedComputer" type="checkbox">
<span>I'm using a shared computer</span><br/>
<input type="submit">
</form>
</body>
</html>
【问题讨论】:
标签: html google-chrome