How to prevent browser from caching form fields?

HtmlFormsAutocompleteBrowser Cache

Html Problem Overview


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.

Html Solutions


Solution 1 - Html

Solution 2 - Html

just add simple script in some global JS:

$("form :input").attr("autocomplete", "off");

Solution 3 - Html

> 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIgorView Question on Stackoverflow
Solution 1 - HtmlsojuView Answer on Stackoverflow
Solution 2 - HtmlA.T.View Answer on Stackoverflow
Solution 3 - HtmlHossein HajizadehView Answer on Stackoverflow