Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Avatar for Username

Шукати в статтях підтримки

Остерігайтеся нападів зловмисників. Mozilla ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

Докладніше
Ця тема перенесена в архів. Якщо вам потрібна допомога, запитайте.
Архівовано

When I code <script>window.history.back();</script> on a page due to a data validation problem, all browsers except Firefox redisplay the filled-out form page.

GaryTheGrape

When I use javascript "window.history.back()" because a user enter invalid text, Firefox returns to the page with the form on it but it clears out the form. All the other browsers go back to the previous page with the form filled out as it was when submit was entered.

Firefox did not used to do this. I do not change browser settings from default to get this unfortunate behavior. This may mean Firefox is more secure, but only on a public computer. On a private computer, this sucks.

When I use javascript "window.history.back()" because a user enter invalid text, Firefox returns to the page with the form on it but it clears out the form. All the other browsers go back to the previous page with the form filled out as it was when submit was entered. Firefox did not used to do this. I do not change browser settings from default to get this unfortunate behavior. This may mean Firefox is more secure, but only on a public computer. On a private computer, this sucks.

Усі відповіді (2)

See if this helps you. https://developer.mozilla.org/en-US/docs/Web/API/Window.history


If not, try posting at the Web Development / Standards Evangelism forum at mozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. http://forums.mozillazine.org/viewforum.php?f=25 You'll need to register and login to be able to post in that forum.

Do you allow caching of the form page? Firefox usually will go back to a cached page and show it just like it was. This article covers some of the scenarios for pages being and not being cached: https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching