Chrome, Safari and Opera do not remember password on simple form

萝らか妹 提交于 2020-01-24 10:33:11

问题


I first had the problem with an AJAX login, and after looking for a solution for hours I thought I would try something as simple as this:

<html>
    <head></head>
    <body>
        <form id="login_form" action="login.html" method="post">
            <input type="text" id="login_username" value="" />
            <input type="password" id="login_password" value="" />
            <input type="submit" id="login_submit" value="Login" />
        </form>
    </body>
</html>

It goes to login.html but does not offer to save the password! I thought it might be a localhost issue so i deployed on the server and still, Chrome does not offer to store the password. FF and IE work as expected but Chrome, Safari and Opera do not.

"Offer to save passwords I enter on the web" is checked.

"Never saved" is empty.


回答1:


Wow. This should be noted somewhere. I suspect it probably is but I just could not find it...

The solution is the name tag in both username and password fields. If these are missing then Chrome will not offer to save the password. Once I added the name tags Chrome and Opera started to offer to save the password.

Safari is still not doing it.

<html>
  <head></head>
  <body>
    <form id="login_form" action="login.html" method="post">
      <input type="text" id="login_username" name="login_username" value="" />
      <input type="password" id="login_password" name="password_username" value="" />
      <input type="submit" id="login_submit" value="Login" />
    </form>
  </body>
</html>


来源:https://stackoverflow.com/questions/16420898/chrome-safari-and-opera-do-not-remember-password-on-simple-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!