Forum Moderators: open

Message Too Old, No Replies

How do you stop IE6 refreshing a form?

Happens every time I go back

         

Hester

12:17 pm on Dec 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have built a form that uses a second page to validate it. JavaScript is used to add extra fields. If there is an error in an extra field, a message is shown on the second page. But if you then go back to correct it, IE6 refreshes the whole page, losing any extra fields and the data in them!

In other browsers, the page is retained, as it is cached.

I have tried various HTTP headers to stop IE6 ignoring the cache, but to no avail. Is there a way?

Another weird thing: on going back, the JavaScript gives a 'missing object' error, even though it works on existing fields. I can add new fields but IE appears to have stopped the DOM updating the document. So you cannot then act on the new fields. Very odd.

RonPK

9:36 pm on Dec 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really an answer to your question, but I usually store the posted data in a session array, which is used to fill the form if the user returns (or if the form is immediately shown again when validation fails). Of course that is pretty useless for dynamically added fields.

IMHO client side caching is an unpredictable mess, and therefor one should not rely on it when building a web app.