Forum Moderators: open

Message Too Old, No Replies

mozilla form clear on reload php pages

how to stop mozilla from caching selected form elements

         

oona

1:11 pm on Feb 3, 2004 (gmt 0)

10+ Year Member



Hallo,
I have discovered that Mozilla does not clear selected form elements such as checkboxes on php pages when the browser reload button is clicked.
The same is true for Netscape 7, but strangely enough not Netscape 6(Have they added this as a feature?!)

Has anybody a solution to this problem, as I need the boxes unchecked on reload?

thanks
oona

tedster

2:49 am on Feb 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Deceptive little challenge, I think. It seems simple, but...

Have you tried a javascript function that cycles through the form elements and explicitly sets sets each one to "null" or "unchecked" as required. Then call that function onLoad.

oona

9:43 am on Feb 4, 2004 (gmt 0)

10+ Year Member



Hallo Tedster, thanks for the reply.

The form results are shown at the bottom section of the form and the users selected items should remain checked when their form is submitted.
If I run a JS Script to uncheck all checkboxes onLoad this won't be the case(or am I mistaken?).

Basically, I want the browser to clear all form data if the user clicks reload, but keep form data when the form is submitted.

I may have to use your solution though, and then send the initial checks back to the form via php when the form is processed.
I had hoped there would be an easier way!

oona