Page 1 of 1
little hangy down thingy
Posted: Mon Jul 19, 2010 10:40 am
by buckit
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
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 10:47 am
by JayBird
Code: Select all
<input type="text" name="foo" autocomplete="off">
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 10:49 am
by buckit
perfect! knew it had to be something simple!
thanks!
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 10:51 am
by pickle
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:
Code: Select all
<input type = "hidden" name = "field_name" value = "230afj" />
<input type = "text" name = "230afj" />
Second, add the "autocomplete" attribute like this:
Code: Select all
<input type = "text" name = "field_name" autocomplete="off" />
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.
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 11:35 am
by buckit
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.
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 12:00 pm
by pickle
buckit wrote:they will be fully aware of all limitations.
Don't kid yourself. Oh sure - you may tell them the limitations, and they may grin & nod, but they'll forget.
Nonetheless, since you're in such a closed environment, the "autocomplete" attribute will work fine.
Re: little hangy down thingy
Posted: Mon Jul 19, 2010 12:06 pm
by buckit
pickle wrote:Don't kid yourself. Oh sure - you may tell them the limitations, and they may grin & nod, but they'll forget.
trust me... I know how that goes!

I have been dealing with these same 2 people for over 10 years... have come to know the best ways to communicate with them by now
