【问题标题】:Html form tag autocomplete="off" attribute not working on chrome browserHtml 表单标签 autocomplete="off" 属性在 Chrome 浏览器上不起作用
【发布时间】:2015-07-18 21:45:11
【问题描述】:

我有用户注册表。表单包含用户名和密码字段。 在用户注册时,用户名和密码字段会自动填充值。

我使用了表单“自动完成”属性,但在 chrome 浏览器上不起作用。

这是我的代码,

<form method="post" action=""  autocomplete="off">
<input type="text" id="first_name" name="first_name">
<input type="text" id="last_name" name="last_name">
<input type="text" id="username_name" name="username_name">
<input type="text" id="password" name="password">

【问题讨论】:

    标签: php html css


    【解决方案1】:

    根据我的经验,Chrome 只会自动完成第一个 &lt;input type="password"&gt; 和前一个 .所以我补充说:

    <input style="display:none">
    <input type="password" style="display:none">
    

    &lt;form&gt;的顶部,这个案子就解决了。

    【讨论】:

    • 天哪,我已经看到了很多针对此的 css 和 js hack!迄今为止最简单的
    猜你喜欢
    • 2013-08-20
    • 2019-12-13
    • 2016-03-20
    • 2014-06-02
    • 1970-01-01
    • 2014-10-03
    • 1970-01-01
    • 2014-05-05
    • 1970-01-01
    相关资源
    最近更新 更多