46

I have a textbox in a form field that gets populated by the user. However currently (in Firefox 10) the user can navigate away from the page, then come back, and the input will be populated with its previous value. I think this creates for a confusing user experience, and would like to prevent it.

Is there a way to do this without manually resetting the value? I have tried changing the response to not cache as well as setting autocomplete='false' with no luck.

Igor
  • 30,885
  • 14
  • 70
  • 107

3 Answers3

64

Try with autocomplete="off", but it will not work with all browsers

PS: duplicate...

Stop browser from filling textboxes with details

Make page to tell browser not to cache/preserve input values

Community
  • 1
  • 1
soju
  • 24,068
  • 3
  • 63
  • 66
12

just add simple script in some global JS:

$("form :input").attr("autocomplete", "off");
A.T.
  • 18,248
  • 7
  • 39
  • 59
5

use meta in head

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">

or Use

<% Response.CacheControl = "no-cache"; %>
<% Response.AddHeader("Pragma", "no-cache"); %>
<% Response.Expires = -1; %>

microsoft

Hossein Hajizadeh
  • 1,029
  • 15
  • 9