2

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 HTML - input value kept after Refresh are exactly the opposite of my problems

Community
  • 1
  • 1
RWW
  • 21
  • 1
  • 3
  • I've also tried "behavior:url('#default#savehistory')" and autocomplete to no avail – RWW Jun 14 '10 at 23:02
  • If this functionality is very important, then just write an AJAX function that dumps the form values into a session on the server and then another AJAX function that repopulates the fields on refresh. – Gert Grenander Jun 15 '10 at 20:47

2 Answers2

6

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.

NotMe
  • 87,343
  • 27
  • 171
  • 245
  • Have them click SAVE, then refresh it. That would be the expected behavior. – NotMe Jun 14 '10 at 23:03
  • http://stackoverflow.com/questions/1877795/how-to-force-internet-explorer-ie-to-really-reload-the-page posts 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 Jun 14 '10 at 23:09
  • @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. – NotMe Jun 15 '10 at 04:55
  • I'm confused by proper, there must be a difference between F5 and ctrl F5 – RWW Jun 15 '10 at 20:03
  • Few years late but... Imagine the situation where a form doesn't submit (server lag, etc.). Pressing the back button gives you a page where you must reload the page... or perhaps you refresh to try and resend the form, but it does not do that. Now you have to redo your form. How in the world is that not a bug? FF has my support in this case. Form data should be kept. Forms don't exactly change that often. (Shitty website forms, mainly corporate/business sites, do this often.) – feildmaster Sep 25 '15 at 17:26
0

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

OdinX
  • 4,135
  • 1
  • 24
  • 33