Force to save or cancel

Is there a way in a form to force the user to either save the data or cancel when they try to navigate away from the form. Just like when In SC IDE you don’t save the changes, then try going to another section, SC wants you to either save the changes or cancel.

I want to make sure my users save their changes or cancel the changes, not just lose them.

Thanks

I have just come across this problem too. I tried using onNavigate but that didn’t work. We actually need a beforeLeave event to make this work.

The problem is that you cannot easily intercept the back button of your browser, or type another url. But you can prevent the use of the backbutton by inserting a piece of javascript

See: http://www.scriptcase.net/forum/forum/scriptcase-8/discussion-aa/68016-how-to-disable-device-back-button-pc-tablet-and-mobile