A simple and practical method to prevent the browser from remembering the user name and password

Source: Internet
Author: User

How do I disable the browser from automatically saving form information, such as the user name and password?
Currently, many browsers use the autocomplete = "off" function, but some browsers still remember the username and password, is there a more effective and convenient way to prevent the browser from remembering the user name and password?

1. Remember the password for the browser
1) First, most browsers determine the password field based on the type = "password" of the form field. In this case, you can use the "dynamically set the password field" method:
Copy codeThe Code is as follows:
<Input type = "text" name = "password" onfocus = "this. type = 'Password'"/>

Explanation: When this document box gets the focus, it is changed to a password domain, so that the browser will not remember the password. Of course, to improve the password, you can also add the autocomplete = "off" attribute.
2) In the onload event, clear the value of the password box, that is:
Copy codeThe Code is as follows:
<Script language = "javascript">
Window. load = function (){
Document. getElementById ('password domain id'). value = '';
};
</Script>

3). The page uses https protocol, because https does not save information on the form.
4). use flash as the login form. In this case, the browser will not record the form information.
5 ). another exception is that you can change type = "password" to type = "text". Because type is not a password, you will not remember the password function. Then, you can set a variable such: var val = "" or set a hidden field <input type = "hidden" name = "val">. Use onpropertychange to replace the password with a single dot and assign the value to val, restore the val value after submission because the effect is the same as the number. Users cannot see it.

2. Automatic table filling for some browser plug-ins
This is troublesome. I think this should be the case where the plug-in remembers the value of the form field name and then fills in the table, I think the value of name can be dynamically changed during page loading. When submitting a form, the value of the form is combined into the correct corresponding value and then submitted. This is not verified, just my personal thoughts. You can try

If the above methods cannot satisfy you, then I cannot.

Suggestion:
Try to clear the cookie under the corresponding domain name. the browser should remember the user name and password Based on the cookie.
(No, Some browsers remember it based on the submitted value after you submit the form)
(Some browsers do not record cookies, which is a headache. By the way, how can I clear the INPUT values? I hope that the input value will not appear again as in the bank)
The browser remembers the password by searching for the input box with the type of password, and then remembering it as the user name in the front input box. To solve this problem, add a text-type input box between the user name input and the password input and set the css attribute display to none.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.