IE provides an AutoComplete feature that remembers what we have entered (such as a login account), and facilitates the next quick entry of similar data. This is really a very friendly function, in the operation only with the mouse double-click the text box or enter the first few characters, the system will automatically list the previous entry history for you to choose, greatly improve the speed and accuracy of the entry. It is believed that most IE users have this feature enabled.
However, as a website developer, we do not want any information to be remembered on the user's computer (such as bank account number and other important account number and password), but we cannot ask the user to disable the auto-complete function. Fortunately IE5.0 after the input type=password, input type=text, FORM and other controls added a AUTOCOMPLETE attribute, to suppress the control auto-completion function, Just set the AutoComplete to off, such as:
A complete form prevents automatic completion
< FORM Method =post Action = "Submit.asp" AUTOCOMPLETE = "OFF" >
B Disable automatic text box completion
< input type = "text" name = "CreditCard" maxlength = "+" AUTOCOMPLETE = "OFF" >
C Disable auto-completion in scripts
function init () {Element.setattribute ("AutoComplete", "Off");}
D If you want to prevent the text box from using the Input method, you can add the ime-mode:disabled in its style, but this does not prohibit the input of Chinese characters, because the user can still
To import Chinese characters by copying and pasting, such as:
< input type =text style = "ime-mode:disabled; " mce_style=" ime-mode:disabled; ">
This is how Microsoft's. NET PASSPORT is done, but there are other ways to do it, because the way it is implemented in Yahoo and Gmail is different.
The TextBox control has a seemingly small but often disturbing little "improvement" that is "AutoComplete" (AutoComplete). What is automatic completion? That is, the textbox will remember the user has entered the text, when the next time the input will automatically prompt the relevant words, the most common is when users log on to the site will automatically bring out the account password.
This function in the earliest was invented when people feel very convenient very easy to use, but with the strengthening of information security awareness, this function sometimes not only not pleasing, but a bit disgusting, now whether it is at home, internet cafes or companies, many people share a computer opportunity a lot, But also because of the automatic completion of the textbox in the cause of the trouble, others want to see your e-mail or even under the guise of your account login page is not difficult, as long as you choose your account in the textbox, the password will usually be brought out automatically.
How to fix it, the AutoCompleteType property built into the TextBox control in ASP. NET 2.0 can easily solve this problem, as long as the TextBox's AutoCompleteType is set to "Disable", AutoComplete prompts do not appear at all.
The memory function of the Disable textbox for ASP.