0

I'm looking to check the page for changes and alerting the user before they leave if items have not been saved. Is it possible to use onBeforeOnLoad with a PageLink from Tapestry? I've tried and so far have had no luck. Thanks.

Dale
  • 1,613
  • 4
  • 22
  • 42

1 Answers1

1

Assuming you meant onbeforeunload, which is javascript and wouldn't have anything do with your page link. Instead, add a script tag at the end of your page with the snippet below:

<script type="text/javascript">
window.onbeforeunload = function() {
    return true;
};
</script>

See this answer for more info.

Jeshurun
  • 22,940
  • 6
  • 79
  • 92