Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a website. It requires users to login.

When I click on the Username text box, as soon as I enter the first letter of the name it turns into a drop down list displaying every name ever entered, that starts with that letter!

I have found a lot of articles on how to accomplish this, but none how to PREVENT this from happening.

I want the text box to act like a text box.

I am using .Net version 4.62



If you know how to stop this from happening, and can reply with the answer, I will be forever grateful.

What I have tried:

I have tried replacing the text box with another, and it does the same thing!
Posted
Updated 4-Mar-21 10:23am
Comments
shanda watkins 5-Mar-21 16:10pm    
That is the default behavior of textboxes.

1 solution

Add the autocomplete="off" attribute to the tag:
<input type="text" autocomplete="Disabled" />


Or in ASP.NET:
<asp:TextBox id="Whatever" AutoCompleteType="Disabled" runat="Server" />
 
Share this answer
 
v3
Comments
Richard Deeming 5-Mar-21 5:31am    
That probably won't work on login fields, with good reason:
The autocomplete attribute and login fields | MDN[^]
Dave Kreskowiak 5-Mar-21 9:40am    
Whoops. That should not have said "off".
Richard Deeming 5-Mar-21 9:42am    
But as the MDN link says: many modern browsers do not support autocomplete="off" for login fields. :)
Dave Kreskowiak 5-Mar-21 9:44am    
This is what I get for trying to code minutes after waking up.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900