我想禁用谷歌浏览器的自动填充和密码建议功能,类似于autocomplete="off"的属性(但这个属性不起作用)。
以下是代码:
loginpage.php
<form class="form-method" method="post">
<span class="form-fill">
<text>Username</text>
<input placeholder="Username" required/>
<text>Password</text>
<input type="password" placeholder="Password" required/>
<button type="submit"></button>
</span>
</form>
anotherform.php
<form method="REQUEST" class="vp-method">
<input type="password" maxlength="4" autocomplete="JUST STOP!"/>
<button type="submit" placeholder="DVN Number">Validate</button>
</form>
如何在不使用 JavaScript 的情况下禁用 Google Chrome 自动完成/建议/自动填充?注意:我知道有类似的问题。但是,那些建议都没有起作用(因为我现在正在输入)。
谢谢 :)
<input type="text" name="whatever" autocomplete="off_<?php echo time() ?>">
这会导致 Chrome 搜索 "off_{time}" 的输入历史记录... 因此它将永远找不到任何内容,从而实质上禁用了它。 - ChrisDeDavidMindflowAU