0

I'm using MVC4 in my web application. I have issue with autocomplete in a specific page that remembers the login credential upon login even if I set autocomplete="off" but it still working. Please help. How to turn off the autocomplete. I also tried adding html attribute to each textbox/EditorFor field but no luck. Autocomplete form is still working. Here's the screenshot of my page and view.

Page as seen in browser

enter image description here

View

enter image description here

Jobert Enamno
  • 4,403
  • 8
  • 41
  • 63
  • Have you looked at this question? http://stackoverflow.com/questions/582244/is-there-a-w3c-valid-way-to-disable-autocomplete-in-a-html-form – Yogiraj May 13 '14 at 13:57

2 Answers2

0

Try these:

<%= Html.TextBoxFor(
    model => model.idName, 
    new { @class = "className", autocomplete = "off" }
)%>

or you can disable with javascript using
$(document).ready(function() {
    $("input:text,form").attr("autocomplete","off");
})
0

Try to do this with jQuery. first put this code just before your div class="row=fluid"

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
 <script>
  function removeAutoComplete(){
  $("input:text").attr("autocomplete","off");
  }

 window.onload=removeAutoComplete;
 </script>

This should help with your case.

Naveen Chandra Tiwari
  • 5,055
  • 3
  • 20
  • 26