1

I have Laravel project with view where user adds form fields dynamically. There's AJAX "SAVE" button and link which opens "print view" of page.

If user hits Back button after printing, there's no dynamically added fields, although they are saved ( - if I reload the page, it renders correctly)

Am I missing something regarding caching these fields?

Paul Floyd
  • 5,530
  • 5
  • 29
  • 43
Yuray
  • 747
  • 1
  • 9
  • 19

1 Answers1

0

ok, i found few possible solutions:

1) target: _blank for links that lead away

2) input type=hidden for dynamically added fields, populated on onbeforeunload, and restored on page load (link)

but i choosed to force reloading pages after back button with such (dyn) content.

after BODY tag:

<input type="hidden" id="tmkReloadTest" value="reloaded" />
<script>
  if(document.getElementById('tmkReloadTest').value!=="reloaded") {
    location.reload();
  }
  window.onbeforeunload = function (e) {
    document.getElementById("tmkReloadTest").value = "fromcache"; 
  }
</script>

hope it helps..

br Y

Community
  • 1
  • 1
Yuray
  • 747
  • 1
  • 9
  • 19