Closed Bug 322047 Opened 20 years ago Closed 17 years ago

Entered form data is lost when reloading the page

Categories

(Toolkit :: Form Manager, defect)

1.8.0 Branch
x86
Windows 2000
defect
Not set
critical

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: eagle3386, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 When I was using the Mozilla Suite (version 1.7.8, AFAIR), the form data was always kept when reloading the page. Firefox doesn't keep it and restores the default values defined in the XHTML source code. Reproducible: Always Steps to Reproduce: 1. Go to the above URI, type in some data. 2. Type some chars into the given fields 3. Press F5 (or your corresponding key for page reloading) Actual Results: Inserted data is lost Expected Results: Firefox should keep the inserted data of the user Due to the page is written by myself I can guarantee that the page is written in native XHTML 1.0 Strict (FF will give you "Standards compliance mode" in the Page Info-dialog).
Version: unspecified → 1.5 Branch
*** Bug 322048 has been marked as a duplicate of this bug. ***
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051231 Firefox/1.6a1 ID:2005123103 I see the same behaviour in Firefox 1.0.7, 1.5 and 1.6a1 and Opera 8.51 (lost data on reload). Internet Explorer doesn't load the page so I can't compare.
(In reply to comment #2) > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20051231 > Firefox/1.6a1 ID:2005123103 > > I see the same behaviour in Firefox 1.0.7, 1.5 and 1.6a1 and Opera 8.51 (lost > data on reload). > Internet Explorer doesn't load the page so I can't compare. > I've added a version for IE - it's available at http://eagle-cage.de/dawn_ie.php?open=Step Because of that your results are like mine it should be changed to CONFIRMED.
See Bug 46845 "Form elements don't reset upon manually reloading page" (193 comments)
Maybe there's a chance for an user-defineable option inside the preferences to choose from which behavior is wanted by a user? And also the question: why must FF act this way? Good programmers *always* put a "Reset"-button on a page when using a form, right?
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060101 Firefox/1.6a1 Just to clarify, when I go to your page and overtype the expression 'BLUB' with something like 'Fröhe Weihnachten und glückliches Neues Jahr' on reqesting a simple reload with, say, Cmd-R, the form is reset. This is a surprise to me (but I can't say whether Firefox is wrong). This doesn't happen with a copy of your page that I have downloaded, so getting a small testcase may need some further work. As you say, your page is sent with a mime type of application/xhtml+xml. Are you able to produce a smaller version of this page with has the same problem. What happens if you take out the scripts?
> Just to clarify, when I go to your page and overtype the expression 'BLUB' > with something like 'Fröhe Weihnachten und glückliches Neues Jahr' on > reqesting a simple reload with, say, Cmd-R, the form is reset. > I did this, too - with both, the dawn.php and with dawn_ie.php. By hitting CTRL + R the page gets reloaded and afterwards the data is lost and the default value (in this case "BLUB" is restored. > This is a surprise to me (but I can't say whether Firefox is wrong). This > doesn't happen with a copy of your page that I have downloaded, so getting > a small testcase may need some further work. You want a small testcase - you got one: http://eagle-cage.de/dawn_min.php (for IE-related testing: http://eagle-cage.de/dawn_min_ie.php) > As you say, your page is sent with a mime type of application/xhtml+xml. > > Are you able to produce a smaller version of this page with has the same > problem. > > What happens if you take out the scripts? Yes, I'm using the header()-function of PHP due to both, the DOCTYPE and the <meta>-tag don't force FF to be in "Standard compliance mode" and because of that I only want true 100% valid XHTML 1.0 Strict-code, I'm in need of this.. ;) Of course, see one paragraph above.. :) In the new testcase are no scripts loaded at all..
Sorry, got a big mistake: the testcase works also in my FF - unfortunately, I've mixed up the two tabs and therefore got the wrong one.. ;) Again, http://eagle-cage.de/dawn_min.php works just fine with CTRL + R and also with F5 on my Win32-platform. So, could you help me finding out what brakes FF's form-cache? :)
Yes, the reduced testcase works for me as expected. My guess is that there is something in your PHP, markup or Javascript which is causing the incorrect behaviour to happen for you. It is unclear at the moment whether there is any defect or bug within Firefox. I strongly suspect that the cause is within the code (probably PHP) that you removed. Sorry to make work, but are you able to progressively reverse your 'reduction' exercise by adding back the code you earlier removed, until you find the part of it that once again brings out the problem. This is the part that we will need to focus on. (This has probably already occurred to you!).
Yes, I can do so - I'll post any progress ASAP.. :)
OK, here we go again: http://www.eagle-cage.de/dawn_try.php?open=Step That's the new testcase and I only played with the file for about 5 minutes. The code which causes FF to not restore the entered data of the user is this: # Start the session session_start(); But session_start(); is required if you want to (re-) use a session. Nevertheless, PHP.net gives some hints: http://de.php.net/manual/en/function.session-start.php The comments made by "shemszotATetkDOTca" and "james at skinsupport dot com" are the ones I'm talking about.. :) So, IMHO it is still kind of a bug due to session_start(); is used by many sites which use PHP..
Flags: testcase+
(In reply to comment #11) > > The code which causes FF to not restore the entered data of the user is this: > > # Start the session > session_start(); > > But session_start(); is required if you want to (re-) use a session. <Possibly off charter> That is php code, not markup. I would have guessed that when your application wants to start, re-start or re-use a session then you as the applcation's author actually want the current form data to be thrown away. You want want to add some some sort of logging or snooping to your system to see what you sending to your clients. Do you think that Firefox is rendering what you are sending? If so, you may find it difficult to characterise this as a bug in Firefox. See Bug 46845 which I thought was about Firefox retaining field values when the same form was sent to it. If your application is forcibly closing/ending sessions and returning a brand new form, (from the user's POV, switching Cmd-Shift-R for Cnd-R) then Firefox is acting by design. If this behaviour is surprising, and I would guess that it is, could you evaluate whether this is your bug and not Firefox's? - but don't take that too literally, I may be on the wrong lines.
(In reply to comment #11) > > Nevertheless, PHP.net gives some hints: > > http://de.php.net/manual/en/function.session-start.php > > The comments made by "shemszotATetkDOTca" and "james at skinsupport dot com" > are the ones I'm talking about.. :) Does session_write_close(); make a difference. If the 'user experience' on your site is dependent on cookies, then you will have to do a lot os testing and checking. If you find that Firefox is not meeting the relevant standards or specifications for cookies, HTTP protocol, caching et cetera, I am sure that someone would be interested in investigating and fixing the problem. > So, IMHO it is still kind of a bug due to session_start(); is used by many > sites which use PHP.. >
Ok, this seems to work properly in FF3. I tried the following form sample: http://www.mozilla.org/wallet/samples/sample1.html When I put in info and reload, it is still there. It is not reset. Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3. Marking as WORKSFORME.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.