0

I know this was answered before but whatever I do, Chrome always shows a list of possible values.

For example, for this field:

<input type='text' id="sFechaCarga" name="sFechaCarga" class="font-12 form-control showCalRanges" autocomplete="off" />

Google thinks this field is a credit card field, showing suggestions for credit cards.

While for this other field:

<input type='text' id="sFechaEstado" name="sFechaEstado" class="font-12 form-control showCalRanges" autocomplete="off" />

Google thinks it is an state value, showing suggestions for states.

I tried to use autocomplete="none" or autocomplete="fdsgsgsg" as someone suggests in some SO threads. I have even used autoComplete="off". None works.

Any help, please?

Regards Jaime

jstuardo
  • 3,901
  • 14
  • 61
  • 136
  • Are you sure that your JavaScript is not messing up with this ? – vS12 Oct 20 '19 at 03:55
  • Possible duplicate of [Disabling Chrome Autofill](https://stackoverflow.com/questions/15738259/disabling-chrome-autofill) – Alireza Sabahi Oct 20 '19 at 06:06
  • @vS12 yes, I am – jstuardo Oct 20 '19 at 18:06
  • @AlirezaSabahi this is not duplicate... as I have told, I have tested everything what was suggested in several S.O. threads. By the way, I think a misconception exists. I have problem with field suggestions. I am not really sure if this is directly related to autocomplete. Autocomplete fills the field automatically, doesn't it? in my case, the field is not pre-filled, but a suggestion list appears. – jstuardo Oct 20 '19 at 18:22
  • Autocomplete gives you a list of suggestions based on what you have entered for same type of inputs previously, it does not fill it. So if you are seeing suggestions even after disabling autocomplete then it is not correctly working. Can you edit the questions and provide more code snippets so that this issue can be reproduced ? – vS12 Oct 20 '19 at 23:14
  • 1
    @vS12 sincerely there is no more code other than autocomplete="off".... but never mind. I don't know if this is a bug in Chrome but I have found a workaround. For example, one input field was called "sFechaEstado". I was wondering why, just for that field, Chrome shows a list of states. My thinking was: the field name contains the word "Estado". "Estado" means "State" so that, based on that part of the name, Chrome tries to guess I need states for that field, what is wrong. I changed the name to be sFechaWorkflow and no more suggestions are shown. Chrome is not that smart! – jstuardo Oct 21 '19 at 11:17

1 Answers1

0

This is not a perfect solution, but it´s working right now. You should add readonly attribute, and then on focus, remove it. Quite simple, not so beauty (if you need it for lot of inputs, you could try adding it by js to minimize code).

<input type='text' id="sFechaCarga" name="sFechaCarga" class="font-12 form-control showCalRanges" readonly="readonly" onfocus="this.removeAttribute('readonly');" />

Fiddle: http://jsfiddle.net/0uzvqjfg/