Jump to content

onbeforeunload problems


Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...