views:

284

answers:

2

Hi, I'm trying to achieve sticky forms without PHP. My setup is AJAX like javascript. The back/forward work fine on both IE and FF, but refresh only works on FF, not IE. Doesn't matter what cache options I use, I've even set IE's temporary files option to never check for updates, and the input value is gone after page refresh(the refresh button or F5)

I've read many posts where people have the opposite problem, and do not want form data to persist across page refresh, and never read from browser cache, but I do.

Any help is appreciated, thanks!

ps. posts like http://stackoverflow.com/questions/1799899/html-input-value-kept-after-refresh are exactly the opposite of my problems

+2  A: 

IE/Chrome/Safari/Opera/etc has the expected behavior.

I consider it a bug that FF doesn't actually refresh the fields when you click refresh.

After all, the purpose of the refresh is to dump what you have and reload from the server. For Firefox to then merge any changed information / fields back into the form is unexpected behavior and, IMHO, bad by design.

Also note that this one issue has been fought over at Mozilla for 10 years. It is a source of MANY duplicate bug reports, is considered by many to be a critical failure, and is quite frankly a complete PITA. I don't know how many times I've had to explain to non-techies why the Firefox reload button doesn't, well, reload the page.

Lately I've taken to just telling them that the Firefox reload button is broken and that they have to either hold down the shift key which clicking refresh or use a different browser. Thankfully we have choices.

--- Update due to a comment stating confusion as to what F5 and Ctrl-F5 are --
All browsers (except Firefox) treat F5 as "reload". Which means reload the page either from cache or from the server if cache is disabled. Firefox does do the reload, but it also repopulates any boxes with stuff you've typed in... Provided those fields still exist. IMHO, this is bad behavior as a page may have changed and you end up in a very invalid state with some things filled in and others not.

To be clear, the cache does not contain what you typed in the page; cache only contains what the server sent you. So Firefox itself takes this extra step of trying to merge previously typed in and unsubmitted data. Again, NONE of the other browsers do this and it is a source of much confusion.

All browsers (including Firefox) treat Ctrl F5 as "reload from server". This ignores any files you've cached (images, css, javascript, etc) and pulls it brand new from the server. Thankfully, Firefox does not merge unsubmitted data back into the page when you do a Ctrl-F5.

Chris Lively
a bug??? how to get that buggy behavior on IE7/8?
RWW
Have them click SAVE, then refresh it. That would be the expected behavior.
Chris Lively
http://stackoverflow.com/questions/1877795/how-to-force-internet-explorer-ie-to-really-reload-the-pageposts like this indicate that IE reads from form values from cache, even though that's undesirable for them, but I'd really like that.
RWW
@RWW: Why would you want to prevent the user from getting the proper function out of there reload button? BTW, that post doesn't show that IE was reading form values, it was showing that IE wasn't going back to the server at all.
Chris Lively
I need IE to read form values from cache
RWW
I'm confused by proper, there must be a difference between F5 and ctrl F5
RWW
A: 

Even though I agree with Chris, would this be of any help?

http://snipplr.com/view/799/get-url-variables/

It would allow you to store things in the URL (like phps GET) and access them with javascript

Chief17
thanks Chief and Chris, I'm using userData to persist the input value.
RWW