Prevent browsers from remembering usernames and passwords

Source: Internet
Author: User

How to set up to prevent the browser from automatically saving form information, such as user name, password?
Now many browsers have the auto-fill function, I use the input on the autocomplete= "off", but in some browsers are still remembered the user name and password, is there a more efficient and convenient way to prevent the browser to remember the user name and password?
1. Remember the password for the browser
1). First, most browsers determine the password domain based on the type= "password" of the form field, so there is a way to "dynamically set the Password field" for this situation:

<input type= "text" name= "password" onfocus= "this.type= ' Password '" autocomplete= "Off"/>

Explanation: When this document box gets the focus, it becomes the password field, so the browser will not remember the password, of course, in order to be more perfect, you can also add the autocomplete= "off" attribute.
2). In the OnLoad event, empty the value of the password box, i.e.:

<script language= "JavaScript" >    window.load = function () {       document.getElementById (' Password domain ID '). value= ';    }; </script>

3). The page uses the HTTPS protocol because HTTPS does not store information on the form.
4). Use Flash to do a login form, in which case the browser does not log form information.
5). Another perverted good, that is, you can change the type= "password" to type= "text", because the type is not password will not appear to remember the password function, and then set a variable such as: Var val= "" or set a hidden field < Input type= "hidden" Name= "Val", and at the end of the Onpropertychange the password to a line of dots, and assign the value to Val, and then return the value of Val back, due to the same effect as the * number. The user is not visible.

Prevent browsers from remembering usernames and passwords

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.