By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,747 Members | 1,482 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,747 IT Pros & Developers. It's quick & easy.

IE cached field population

P: 4
I'm working on a site that uses a Google Custom Search. The search box is set with a background image (a watermark reading "Google(tm) Custom Search"). When the box has focus, its background is white, otherwise it's the watermark if there is no text in the box. So far so good.

Now, in IE, there appears the annoying bug that if you enter a query in the box, go to the search page, and then hit Back, both the watermark and the search text is in the box (until you give it focus). In my testing, it appears that, when the Javascript tests whether the box is empty or not, the field is empty, but is populated with the cached field value afterwards, which means that the watermark is added and THEN the text is filled. I've tried adding the function that tests the field value as an body onload event handler, to the same result. Strangely, I've even tried setting the value to be empty, and IE seems to overwrite the set value when it populates from the cache.

This could probably be fixed by sending no-cache headers, but I don't want to completely disable caching for all pages. Does anyone know more about this issue? Is there some event I could observe that would occur after the field is filled from cache?

tl;dr when does IE populate fields from cache?
Dec 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: 4
Nevermind, I got it.
Dec 3 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.