I have an intranet page with some javascript that replaces the submit button with a message along the lines of “Getting data. Please wait…”
If I press the back button in firefox on the resulting page, it goes back to the altered page with no submit button.
If I do the same in IE (8) I get the submit button back.
I will wash my mouth out with soap after saying this: but I want the IE behaviour, not the firefox behaviour.
There, I said it. IE actually does something more preferable than what firefox does. (in this case at least)
Is there a way to make firefox do the same? As a work around I have made the message appear as well as the submit button, so should anyone want to go back using the browser’s back button, they can still submit the form again. *But Ideally I want to replace the button to avoid trigger-happy employees thinking “uhhhhhh is it doing anything duhhh uhhhhh, sniff…” <click>… … <click> <click> <CLICK>
[SUB]*I’m not actually asking how to do this. This sentence is just a bit of explanation about why I intend to replace the submit button. I’m asking how to get the ‘fresh’ page when the back button is submitted as in IE, rather than the javascript modified page that FF returns[/sub]
If I understand you right, you have a web page with a button; you press the button and the button changes to a “please wait” message; then after some time you are redirected to a second page. You want the back button to take you back to the page with its button, but FF shows you the page as you last saw it, with no button.
I don’t know how IE or FF handle the back-button history internally, so I don’t know the best way to do this. One way that works is to add a <body onunload=“reset()”> handler that restores the Submit button just before the next page is loaded. This may cause the button to reappear briefly as the page switches, and it’s kind of ugly, but I thought I’d mention it since nobody else has replied.
When IE and Firefox differ, it’s almost guaranteed that Firefox is following the standard, but I’m not so sure here. While the text should stay, There’s no way the button should still be gone. I’d try logging a bug report.
And, yes, the work around seems to be using onunload. Write a method that will reset the button, but not the form text (unless you want the text gone as well).