I know this question has a lot of answers. I have looked through all the solutions to disable google autocomplete(the drop down of suggestions), like using autocomplete=0ff or autocomplete=false, but nothing has solved the issue. I have created an MVC app that has views with dropdown lists and HTML EditorFor.
One solution to add a name to the HTML editor for, helped to remove autocomplete, however since I changed the name of the HTML EditorFor, I had an issue posting back the value.
<div class="col-md-10">
@Html.EditorFor(model => model.Address, new {htmlAttributes = new { @class = "form-control", @id = "show_address", Name = Guid.NewGuid().ToString(), autocomplete = "noped" } })
</div>
Does anybody have a solution for 2019 to disable the google autocomplete?
Update:
I tried using html.textboxfor(as given in the first solution below), however I have realised that autocomplete=off only works if there is one other textboxfor in the view. If there is multiple textboxfor in the same view, using autocomplete=off on any of the Html Textboxfor will not work for any of them to disable autocomplete! Can anyone please help?