How to disable text box memory function implementation method Daquan, text box Daquan
How to disable text box memory
However, as a website developer, I do not want to store any information or materials on users' computers (such as bank accounts and other relaxed accounts and passwords ), however, we cannot require users to disable the auto-implemented function. fortunately, after IE5.0, It is INPUT type = password, INPUT type = text, FORM, and other controls that add an AUTOCOMPLETE attribute. to restrict the Automatic completion of the control, you only need to set AUTOCOMPLETE to off, for example:
Automatic Implementation of entire form Suppression
The Code is as follows:
<FORM method=post action="submit.asp" AUTOCOMPLETE="OFF">
Automatic Text Box Suppression
The Code is as follows:
<input type="text" name="creditcard" maxlength="16" AUTOCOMPLETE="OFF">
Disable Automatic completion in script
The Code is as follows:
function init(){ element.setAttribute("AutoComplete", "off");}
In addition, if you want to disable the text box from using the input method, you can add ime-mode: disabled to its style. However, in this case, the Chinese characters cannot be entered, because the user can still copy and paste the input Chinese characters. for example:
The Code is as follows:
<input type=text style="ime-mode: disabled ; ">
How Microsoft's. net passport is implemented, but there should be other methods, because the implementation methods of YAHOO and GMAIL are different.
What are the new content of the TextBox Control in. NET? Well! There is a small "improvement" That seems small but often causes interference, that is, "AutoComplete ). What is automatic implementation? That is, TextBox will remember the text you have entered. When you enter the text again next time, the related words will be automatically prompted. The most common note is that the account password will be automatically taken out when the user logs on to the website.
When this function was first invented, everyone thought it was very convenient and easy to use. However, with the enhancement of information security awareness, this function is occasionally not flattering. Instead, it is quite annoying. Why? At this moment, whether at home, Internet cafes, or companies, there is a lot of time for many people to share a computer, and it is also because the automatic implementation of TextBox is at work, it is not difficult for others to view your email or even log on to the webpage by using your account without your account. However, after selecting your account in the TextBox, the password will be automatically taken out.
How can we solve this annoying problem. The AutoCompleteType attribute built in the TextBox Control of ASP. NET 2.0 can easily solve this problem. If you configure the AutoCompleteType of TextBox to "Disable", the automatic implementation prompt will not appear.