2

When I fill a text input within Chrome (and maybe the same on FireFox and Internet Explorer) I have an AutoFill pop-up that is hiding my AutoComplete AJAX pop-up. See photo below.

Form containing 'cann' with Chrome autofill overlapping AJAX autofill

I try to add autocomplete="off" but it didn't do anything and I learned that modern browser will not take these into account autocomplete="off" anymore.

How can I forbid Chrome to pop-up this useless AutoFill div that simply hides my AJAX AutoComplete div?

my problem is the autofill popup, not the autocomplete feature ...

zeus
  • 9,795
  • 5
  • 45
  • 112
  • possible duplicate of [How do you disable browser Autocomplete on web form field / input tag?](http://stackoverflow.com/questions/2530/how-do-you-disable-browser-autocomplete-on-web-form-field-input-tag) – Conspicuous Compiler Mar 17 '15 at 23:03
  • yes but this not work also, they sugest to random the name, me i even remove the name of the input ! but nothing help and still show the autofill popup ! – zeus Mar 18 '15 at 09:07

2 Answers2

1

The goal is to disable the chrome autocomplete popup when typing in my field named "Town / Zip Code* :", because I need to display my own ajax popup with a cities list.

Here is a working solution, after many hours of search :

<form method="post" action="">
<br/><label for="address">Address :</label><input type="text" id="address" name="address" value="">
<br/><label for="address2"></label><input type="text" id="address2" name="adress2" value="">
<br/><label for="code"><input style="display:none" />Town / Zip Code* :</label><input type="text" id="code" name="code" autocomplete="off" value="">
<div style="display:none"><br/><label for="city"></label><input type="hidden" id="city" name="city" value="0"></div>
<br/><label for="country">Country</label><select id="country" name="country"><option>France</option></select>
<br/><input type="submit" name="valider" value="ok">
</form>

Explanation : Chrome is parsing field names, field values, and labels preceding fields. If he detects that a word of "Adresses/Cities/Zipcodes" lexical field matches with your form, he enables the autocomplete and autofill popup for all the fields...

So I've renamed the input field and label with "code" instead of "zipcode", I've added "<input style="display:none" />" before the zipcode label text, and it worked ! There is other solutions like removing labels, change input name/id, add <td> tags.

Hope it will help !

mazo0012
  • 11
  • 3
-5

Simple. To turn off Chrome's Autofill, go to Settings->Click on "Show Advanced Settings"->Find the Passwords and Forms section->Un-check the "Enable AutoFill to fill out web forms in a single click." checkbox.

racecarjonathan
  • 1,210
  • 1
  • 11
  • 21
  • 2
    I believe OP is looking for a way, as a web developer, to disable auto-complete from occurring on the user side, not just on his development machine. – Conspicuous Compiler Mar 17 '15 at 23:02
  • 1
    @ConspicuousCompiler Honestly, I was on the fence thinking about that as well. Decided to play it safe and post this answer. And on a completely irrelevant topic, I like what you've written in your "About Me". Very nice. – racecarjonathan Mar 17 '15 at 23:08
  • yes off course i want a way to deactivate it as a web developper on the user side !! it's crazy this stuff, even an input without any name in it show the autofill popup ! – zeus Mar 18 '15 at 09:04