However, as a website developer, it is not desirable to have any information on the user's computer (such as bank accounts and other important accounts and passwords), but we can not ask users to disable the automatic completion of the function. Fortunately after IE5.0 for the input type=password, input type=text, FORM and other controls to add a AutoComplete properties, to prevent the control automatically complete function, just the AutoComplete set to off, such as:
The entire form prevents automatic completion
Copy Code code as follows:
<form method=post action= "submit.asp" autocomplete= "Off" >
Prevent text boxes from completing automatically
Copy Code code as follows:
<input type= "text" name= "CreditCard" maxlength= "" "autocomplete=" Off ">
Disable automatic completion in script
Copy Code code as follows:
function init ()
{
Element.setattribute ("AutoComplete", "off");
}
In addition, if you want to prevent text boxes from using Input method, you can add ime-mode:disabled to its style, but this does not prevent the input of Chinese characters, because the user can still copy and paste input characters.
Copy Code code as follows:
<input type=text style= "ime-mode:disabled; ">
This is how Microsoft's. NET PASSPORT is implemented, but there are other ways to do it, because the way in which Yahoo and Gmail are implemented is different.
. What's new in the TextBox controls in net? Well! There is a seemingly small but often disturbing small "improvement" is "automatic Completion" (AutoComplete). What is automatic completion? That is, the textbox will remember the user has entered the text, when the next input will automatically prompt the relevant words, the most common is the user login site will automatically bring out the account password.
This function was first invented when we feel very convenient and easy to use, but with the strengthening of information security awareness, this function is sometimes not pleasing, but a bit disgusting, why? Now whether it is at home, internet cafes or companies, many people share a computer a lot of opportunities, but also because of the automatic completion of the textbox in the cause of trouble, others want to see your e-mail even under the guise of your account login page is not difficult, as long as in the TextBox select your account, Passwords are usually brought out automatically together.
About the annoying question, I was asked by my friends how to solve it. The AutoCompleteType property built into the TextBox control in ASP.net 2.0 can easily solve this problem, and the automatic completion prompt will not appear if the TextBox's AutoCompleteType is set to "Disable".