From f2320f0aa4b874d44e004863bbf109a4d8e26e66 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 6 Sep 2012 11:56:19 +0000 Subject: [PATCH] autocomplete=off in HTML prevents FF and Chrome from preserving fields on clicking Back button, so reset it using JS --- hinter.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hinter.js b/hinter.js index e443772..cdc9702 100644 --- a/hinter.js +++ b/hinter.js @@ -370,7 +370,10 @@ var SimpleAutocomplete = function(input, dataLoader, multipleDelimiter, onChange self.hide = function() { if (!self.skipHideCounter) + { self.hintLayer.style.display = 'none'; + self.input.autocomplete = 'on'; + } else self.skipHideCounter = 0; }; @@ -384,6 +387,7 @@ var SimpleAutocomplete = function(input, dataLoader, multipleDelimiter, onChange self.hintLayer.style.top = (p.top+self.input.offsetHeight) + 'px'; self.hintLayer.style.left = p.left + 'px'; self.hintLayer.style.display = ''; + self.input.autocomplete = 'off'; } };