【发布时间】:2018-09-04 09:27:24
【问题描述】:
我听说现在所有的网络浏览器都会忽略autocomplete="off" 属性,因为它会阻止用户更改密码以便于记住(从而破解)。
但就我而言,我只想禁用更改密码表单的自动完成功能,而不是登录表单。我该怎么办?
这是我的(简化的)代码:
<!DOCTYPE html>
<html>
<body>
<form action="?page=change_pass" method="POST">
<input type="password" name="oldPass" placeholder="Current password">
<input type="password" id="p1" name="newPass" placeholder="New password">
<input type="password" id="p2" placeholder="Confirm new password">
<button type="submit">Change password</button>
</form>
<script>
//This script checks if p1 == p2
</script>
</body>
</html>
感谢您的帮助。
【问题讨论】:
-
你能发布你的代码吗?这对想要帮助的人会有所帮助
-
@ReyNorbertBesmonte 完成,时间抱歉
-
根据我的经验,密码类型默认没有自动完成功能。
-
顺便说一句,我很想知道像我一样将 GET 参数直接放在
action属性中是否正确。 -
如果您使用密码,切勿使用 GET。请参考此链接了解区别w3schools.com/tags/ref_httpmethods.asp
标签: html forms autocomplete