0

we have used jquery autocomplete for an input box so that user is given suggestions as he types along.

the issue we are facing is that most of the time the jQuery's suggestion list is hidden behind the browser's suggestion list . and if we press Escape, the jquery suggestion list probably also disappears.

have tried to use autocomplete="off" but doesn't seem to have any affect at least in Chrome

personally do not want to complicate the matter by using session keys to make the name unique like suggested in the following post

How do you disable browser Autocomplete on web form field / input tag?

the complete tag is as under:

<input type="text" class="form-control" id="EmployeeName" value="@Model.EmployeeName" autocomplete="off" />

any help appreciated.

Abdul Ali
  • 1,631
  • 6
  • 23
  • 48

1 Answers1

0

Recently had to debug this too we found that autocomplete="new-password" did the trick as a completely random workaround

<input type="text" autocomplete="new-password" />

now you've provided more information from the comments see https://code.jquery.com/ui/1.12.1/jquery-ui.js

take note of the line that says

this.element.attr( "autocomplete", "off" );

needs to change to

this.element.attr( "autocomplete", "new-password" );

looks like the plugin hasn't been updated for handling this chrome bug. You could update the jquery-ui plugin directly, override it in a custom script, choose a different plugin.

digital-pollution
  • 1,017
  • 6
  • 13
  • same issue in this case well.. when given `autocomplete="new-password"` , the browser still renders `autocomplete="off"`. Have even tried to clear cache – Abdul Ali Mar 18 '19 at 10:09
  • thats strange, is some javascript interfering with it? browser shouldn't be changing this value have to tested with turning javascript off? It must be an issue with the jquery plugin, it might be forcing the value. – digital-pollution Mar 18 '19 at 10:44
  • we are using jquery autocomplete plugin on the tag that is why the normal autocomplete needs to be hidden so that the user can see the suggestions received from the server – Abdul Ali Mar 18 '19 at 10:50
  • which one mate theres lots of jquery autocomplete plugins, can you post the url and check the plugin to see if it is forcing autocomplete off – digital-pollution Mar 18 '19 at 10:57