Den här webbplatsen har begränsad funktionalitet medan vi utför underhåll för att förbättra din upplevelse. Om en artikel inte löser ditt problem och du vill ställa en fråga har vi vår gemenskap som väntar på att hjälpa dig på @FirefoxSupport på Twitter, /r/firefox på Reddit.

Sök i support

Akta dig för supportbedrägerier: Vi kommer aldrig att be dig att ringa eller skicka ett sms till ett telefonnummer eller dela personlig information. Rapportera misstänkt aktivitet med alternativet "Rapportera missbruk".

Läs mer

Reload page doesn't reset Javascript checkbox to "off"

  • 3 svar
  • 5 har detta problem
  • 598 visningar
  • Senaste svar av cor-el

more options

I posted this problem back in March regarding FF 3.6.14. I've now upgraded to 4.0.1 and the problem still hasn't been fixed! I can't imagine this isn't a problem for other commercial websites, so I'm at a loss to understand why it hasn't been fixed yet. Here is the description I gave before, which hasn't changed:

I've been creating a new web page and have "onload" in the body tag, which resets all checkboxes in a form. It was working fine when I reloaded the page, while I was using Firefox 3.6.13. But then I updated to Firefox 3.6.14 yesterday or the day before, and suddenly it's not working. Other instructions in the javascript are working (resetting the color of boxes in the form) but it won't reset checkboxes to be unchecked. I have a reset button that calls the same script and it works find; it's just when I reload the page that it doesn't work. It does still work in IE8, though.

I posted this problem back in March regarding FF 3.6.14. I've now upgraded to 4.0.1 and the problem still hasn't been fixed! I can't imagine this isn't a problem for other commercial websites, so I'm at a loss to understand why it hasn't been fixed yet. Here is the description I gave before, which hasn't changed: I've been creating a new web page and have "onload" in the body tag, which resets all checkboxes in a form. It was working fine when I reloaded the page, while I was using Firefox 3.6.13. But then I updated to Firefox 3.6.14 yesterday or the day before, and suddenly it's not working. Other instructions in the javascript are working (resetting the color of boxes in the form) but it won't reset checkboxes to be unchecked. I have a reset button that calls the same script and it works find; it's just when I reload the page that it doesn't work. It does still work in IE8, though.

Alla svar (3)

more options

Firefox is very aggressive about caching, so I'm surprised it worked before. This article may help in coding around that: https://developer.mozilla.org/en/using_firefox_1.5_caching (check out the Sample Code section)

more options

Thanks jscher2000. I'll check it out and see if I can get it to work. I'll report back one way or the other (but probably won't be immediately).

more options

You need to bypass the cache to reset forms.

Reload web page(s) and bypass the cache.

  • Press and hold Shift and left-click the Reload button.
  • Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
  • Press "Cmd + Shift + R" (MAC)