- set the Basic Form's trackResetOnLoad to true
- handle the form's dirtychange event
something like this:
function my_onbeforeunload(e){ message = 'You have unsaved changes. Are you sure you want to leave this page?'; e = e || window.event; if(e){ e.returnValue = message; } return message; } form.on('dirtychange', function(basic, dirty, eOpts){ window.onbeforeunload = dirty ? my_onbeforeunload : null; });
No comments:
Post a Comment