Html表单标记autocomplete =“off”属性不适用于chrome浏览器

问题描述:

I have user registration form. Form contains username and password field. At the time of user registration username and password fields automatically populated values.

I have used form "autocomplete" attribute, but not working on chrome browser.

This is my code,

<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">

我有用户注册表。 表单包含用户名和密码字段。 用户注册用户名和密码字段的时间自动填充值。 p>

我使用了表单“autocomplete”属性,但没有使用chrome浏览器。

这是我的代码, p>

 &lt; form method =“post”action =“”autocomplete =“off”&gt; 
&lt;  ; input type =“text”id =“first_name”name =“first_name”&gt; 
&lt; input type =“text”id =“last_name”name =“last_name”&gt; 
&lt; input type =“text”id  =“username_name”name =“username_name”&gt; 
&lt; input type =“text”id =“password”name =“password”&gt; 
  code>  pre> 
 
 

div>

In my experience, Chrome only autocompletes the first <input type="password"> and the previous . So I added:

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

To the top of the <form> and the case was resolved.