Forms inputs value are not reset after browser refresh

Hello, I'm using Laravel 5.2 and I noticed that when I refresh my page (with the browser or with f5), the value of my inputs in my forms are not reset (the problem concerns all my pages that contain a form). Someone know if it's a normal behavior of Laravel 5.2 or if it's an issue ? And how I could resolved this problem.

Thank you !

lagbox replied 1 year ago

Shift + refresh.

Khoya91170 replied 1 year ago

Thank you for your reply, it works with shift + refresh, but I can not impose my users to use shift + refresh. Moreover, in all of my php project (without using laravel) when I refresh it works, so I don't know how to resolve this

LaurentMeganck replied 1 year ago Solution

If you are using firefox, it's a know "bug/feature" that firefox will remember what you entered before you hit refresh.

You could try the following:

<form autocomplete="off">
Khoya91170 replied 1 year ago

Thank you, it works !!!!! But I'm a little bit curious, why it does like that ? Laravel store in cache of firefox all inputs and firefox doesn't know how to reset all input ?

LaurentMeganck replied 1 year ago

It's an issue with firefox. For some reason the firefox devs think it's a useful feature. Nothing to do with the laravel cache.

Khoya91170 replied 1 year ago

Ok I see. So thank you for your explaination. Have a good day !

dwainbeck replied 2 months ago

I had this same issue where I had a selection list to change the status of an item. Whenever new item were stored in the database, on a Firefox page refresh the status wasn't showing the correct values from the database, it was showing what firefox was remembering.

Using the fix above I was able to resolve this error.

I guess its a feature when you want to refresh a page but keep data entered in forms, but it might look like a bug when when you don't want it to remember the entered or selected values.

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us