Casey Posted July 23, 2018 Report Share Posted July 23, 2018 My client would like some of the larger forms on our project to alert the user if they attempt to navigate away before using the submit button. Obviously I want to use a beforeunload event listener for this but I can't get it to fire. In preview mode it fires an error because of the cross-source of the event listener, which is fine. But in the live version it simply doesn't fire at all. I'm using pretty simple syntax: window.addEventListener("beforeunload", function(event) { event.returnValue = "Write something clever here.."; }); Is this something that Caspio suppresses? Is there a workaround? My client is pretty adamant about this functionality. Quote Link to comment Share on other sites More sharing options...
Casey Posted July 23, 2018 Author Report Share Posted July 23, 2018 Ok, I solved it for myself. It isn't working within the datapage footer but when I put the script on the footer of the webpage that I've embedded into the datapage it seems to work just fine Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.