2017-05-08 115 views
0

这是登录表单浏览器保存的密码显示在输入错误

<form method="post"> 
    <input name="username" type="text" /> 
    <input name="password" type="password" /> 
</form> 

登录后,还可节省浏览器的密码,我去用户管理页面

<form method="post"> 
    <input name="email" type="text" /> 
    <input name="name" type="text" /> 
    <input name="password" type="password" /> 
</form> 

此页面,浏览器显示密码和用户名默认为名称和密码

如何解决?标签的

https://i.stack.imgur.com/uniJY.jpg

https://i.stack.imgur.com/7ZbTJ.jpg

回答

0

二手autocomplete属性。 阅读此链接:https://www.w3schools.com/tags/att_form_autocomplete.asp

+0

仅用于输入的自动完成。这个用户名和密码通过浏览器保存的“管理密码” – Omid

+0

你好@omid id设置你的文本框的值,并调用JavaScript的onload功能是这样的:函数f(){ 的document.getElementById(“电子邮件”)值=“”; \t document.getElementById('name')。value =“”; } –

+0

不适用于我 – Omid

0

自动完成。 autocomplete="off|on".

“当自动完成功能打开时,浏览器将根据用户之前输入的值自动完成值。” link

<form method="post" autocomplete="on"> 
    <input name="email" type="text" /> 
    <input name="name" type="text" /> 
    <input name="psw" type="password" /> 
</form> 

也shouls使用不同的输入名字。

+0

只有输入自动完成。这个用户名和密码通过浏览器保存的“管理密码” – Omid

+0

它很难明白你实际上是在寻找我不认为你的问题正确地解释它。 –

+0

我添加图像的问题 – Omid

0


<form method="post"> 
    <input name="email" type="text" /> 
    <input name="name" type="text" /> 
    <input name="password" type="password" /> 
</form> 

更改代码

<form method="post"> 
    <input name="email" type="text" autocomplete="off"/> 
    <input name="name" type="text" autocomplete="off" /> 
    <input name="password" type="password" autocomplete="off"/> 
</form> 

https://www.w3schools.com/tags/att_input_autocomplete.asp

也许更改名称属性。