You start typing in an input field and the browser drops down previously entered values.
I love that feature normally... but in a form I am creating you start to type in someones name and it uses ajax to populate a div below it with matches from a database... you click the one you want and it populates some other fields... problem is the browser is dropping down all the previous entries I have entered for testing and its covering the div I am populating.
is there a way to disable that? Im not sure what its technically called and 'prevent hangy down thingy' doesn't return what I want on Google LOL
little hangy down thingy
Moderator: General Moderators
Re: little hangy down thingy
Code: Select all
<input type="text" name="foo" autocomplete="off">Re: little hangy down thingy
perfect! knew it had to be something simple!
thanks!
thanks!
Re: little hangy down thingy
Edit: I see ~Jaybird beat me to the punch. I'll post anyway because I have more info
There are a couple ways. First - you could name that field randomly. Something like this:
Second, add the "autocomplete" attribute like this:
I think. I've never actually used it because it's not standards compliant. Almost all modern browsers implement it, but it's not part of a standard. Since you're using Javascript anyway, you could add the attribute with Javascript & still stay standards compliant.
There are a couple ways. First - you could name that field randomly. Something like this:
Code: Select all
<input type = "hidden" name = "field_name" value = "230afj" />
<input type = "text" name = "230afj" />Code: Select all
<input type = "text" name = "field_name" autocomplete="off" />Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: little hangy down thingy
Thanks for the further explanation. I thought about randomizing the name since thats how it knows to populate... but I figured there would be an easier way.
This is a basic project that needs up and running sooner than later and will only be used by 2 people who both exclusively use Chrome (dont ask, I dont know, not going to change) so thats the only thing it needs to work in for now... they will be fully aware of all limitations.
This is a basic project that needs up and running sooner than later and will only be used by 2 people who both exclusively use Chrome (dont ask, I dont know, not going to change) so thats the only thing it needs to work in for now... they will be fully aware of all limitations.
Re: little hangy down thingy
Don't kid yourself. Oh sure - you may tell them the limitations, and they may grin & nod, but they'll forget.buckit wrote:they will be fully aware of all limitations.
Nonetheless, since you're in such a closed environment, the "autocomplete" attribute will work fine.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: little hangy down thingy
trust me... I know how that goes!pickle wrote:Don't kid yourself. Oh sure - you may tell them the limitations, and they may grin & nod, but they'll forget.