Firefox doesn't retain form data when clicking back button

I just found out that my website users are losing for data if they encounter an error message and need to click the browser back button to fix it. Does anyone know why this only happens with Firefox or, more important, how to address this issue?

Thank you!

Could you please post your code for the form? You haven’t noticed this happening in any of the other browsers?

The form is quite complex, involving mySQL database lookups, PHP, html, etc. It works fine for almost everyone who comes to our site. It only has affected a handful of people.

What are some causes why this might be a browser specific issue?

Thank you!

Retaining data in form fields when doing things like hitting the back button is best handled by your backend script, such as PHP. Is that set up in your case? If not, I would expect the same thing to happen in all browsers.

1 Like

Hi, busboy,

It does not sound like you are asking about an HTML/CSS coding issue. If you believe this might be a Firefox specific issue, I would suggest that you go to the Mozilla developer’s web site and search for any known problems that match your description. They publish everything about every issue very openly.

As @ralphm I would expect this to happen in all browsers, not just FF. If you want the browser to show the value the user entered you’re going to have to do something like the following (for text fields):

value="<?php if (isset($yourName)) echo $yourName; ?>"
1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.