Html Safari覆盖编辑用户表单上的电子邮件和密码字段
我有一个编辑用户表单:Html Safari覆盖编辑用户表单上的电子邮件和密码字段,html,autocomplete,safari,passwords,autofill,Html,Autocomplete,Safari,Passwords,Autofill,我有一个编辑用户表单: <form method="post" action="index.php" /> Email: <input type="text" name="email" value="user@domain.com" /> Password: <input type="password" name="password" value="thesavedpassword" /> </form> 电邮: 密码:
<form method="post" action="index.php" />
Email:
<input type="text" name="email" value="user@domain.com" />
Password:
<input type="password" name="password" value="thesavedpassword" />
</form>
电邮:
密码:
Safari为我覆盖了预先填写的用户名和密码,所以我添加了所有的自动完成选项——这不起作用
在这里继续读下去,我听说readonly已经对一些人起了作用,所以我也试过了,但仍然不起作用。下面是代码的全部内容:
<form method="post" action="index.php" autocomplete="off" />
Email:
<input type="text" name="email" value="user@domain.com"
autocomplete="off" readonly onfocus="this.removeAttribute('readonly');" />
Password:
<input type="password" name="password" value="thesavedpassword"
readonly autocomplete="off" onfocus="this.removeAttribute('readonly');" />
</form>
电邮:
密码:
我真的不知道从这里到哪里去!为什么Safari会覆盖已经填写的字段
非常感谢 密码管理引擎将在检测到密码字段后立即启动,一旦检测到,它将在密码字段之前查找最近的文本字段,并假定其中一个字段是用户名字段 大多数浏览器都会忽略autocomplete属性,但我读到,将其设置为“false”而不是“off”对某些浏览器(不是我)有效
没有干净的解决办法。唯一对我有效的方法是引入隐藏的虚拟字段,以便safari填充。密码管理引擎将在检测到密码字段后立即启动,一旦检测到密码字段,它将在密码字段之前查找最近的文本字段,并假设该字段是用户名字段 大多数浏览器都会忽略autocomplete属性,但我读到,将其设置为“false”而不是“off”对某些浏览器(不是我)有效 没有干净的解决办法。唯一对我有效的方法是引入隐藏的虚拟字段,以便safari填充