Chrome ignores autocomplete=“off”

后端 未结 30 2160
礼貌的吻别
礼貌的吻别 2020-11-22 00:42

I\'ve created a web application which uses a tagbox drop down. This works great in all browsers except Chrome browser (Version 21.0.1180.89).

Despite both the

30条回答
  •  感动是毒
    2020-11-22 01:08

    After the chrome v. 34, setting autocomplete="off" at

    tag doesn`t work

    I made the changes to avoid this annoying behavior:

    1. Remove the name and the id of the password input
    2. Put a class in the input (ex.: passwordInput )

    (So far, Chrome wont put the saved password on the input, but the form is now broken)

    Finally, to make the form work, put this code to run when the user click the submit button, or whenever you want to trigger the form submittion:

    var sI = $(".passwordInput")[0];
    $(sI).attr("id", "password");
    $(sI).attr("name", "password");
    

    In my case, I used to hav id="password" name="password" in the password input, so I put them back before trigger the submition.

提交回复
热议问题