0
由于我无法确定的原因,当提交表单时,密码字段正在填充。这只发生在Firefox。禁用Firefox自动完成功能?
这是我的表格。
<form action="index.php/admin/settings/account" autocomplete="off" method="post">
<section>
<label for="email">Email</label>
<input type="text" name="email" value="[email protected]" autocomplete="off" />
</section>
<section>
<label for="password">Password</label>
<input type="password" name="password" value="******" autocomplete="off" />
</section>
<section>
<label for="confirm_password">Confirm Password</label>
<input type="password" name="confirm_password" value="******" />
</section>
<section>
<input type="submit" name="save" value="Save" />
</section>
</form>
<script>
console.log($('input[name="password"]').val());
$('form').submit(function(e) {
e.preventDefault();
console.log($('input[name="password"]').val());
});
</script>
正如你所看到的。我已在表单和相关字段上设置了autocomplete="off"
。如果我保存表单而不进行更改。自动填充不会触发。
如果我将电子邮件地址更改为带有保存密码的电子邮件,则在提交表单时会更改密码。
这是我在控制台中得到的。
Firefox。
******
123123
铬
******
******
有没有人碰到这个才来的呢?我该如何阻止?
你可以运行覆盖自动完成=关闭的Firefox扩展吗? – Barmar 2012-08-13 18:40:19