0

I know there is a lot of questions here with the same problem. I have tried A LOT of solutions but none has worked for me. I got a back button but it clears the form content in IE8 (not in other browsers) and I need it to work in IE8. When I started with my code I used:

<input type="button" value="Back" onclick="history.back(-1)" />

And it worked, for a while! But suddenly it stopped working and clears the form content for me. I don't know why..

I have tried:

http://www.w3schools.com/jsref/met_his_back.asp

<a id="backButton" title="Back" href="javascript:history.go(-1)" return true;">Back</a>

<a id="backButton" title="Back" href="javascript:history.go(-1)" return false;">Back</a>

<input type="button" value="Back" onclick="window.history.back()" />

<button onclick="history.back()">Back</button>

The button is working but i clears the form JUST in IE..

UPDATE

I tried with a new dokument with one if/else-statement and it's working. But when I use nestred if/else-statements it won't work. IE8 clears the form.

Treps
  • 780
  • 3
  • 12
  • 28
  • It would helpif we could see a form, so we can see how you are populating it in the first place. – Relaxing In Cyprus Sep 19 '13 at 11:29
  • Make a fiddle and share it so we can try it out ! – Arun Sep 19 '13 at 11:47
  • I use a standard form and echo it out with PHP. Use a if-statement to check the form for correct content and shows a error message if not correct data is in the form. With a back button. When that button is pressed the form is cleared in IE but note Chrome for example. – Treps Sep 19 '13 at 12:05
  • 1
    that is up to the browsers implementation. you could try storing it on your server. – Daniel A. White Sep 25 '13 at 13:43
  • Havn't tought about using sessions. I will try that, thx! :D – Treps Sep 26 '13 at 08:19
  • Following link could help.. similar issue http://stackoverflow.com/questions/261351/browser-back-button-restores-empty-fields – Dilip Rajkumar Nov 07 '13 at 14:24

0 Answers0