Here in stackoverflow, if you started to make changes then you attempt to navigate away from the page, a javascript confirm button shows up and asks: \"Are you sure you want
jquerys 'beforeunload' worked great for me
$(window).bind('beforeunload', function(){ if( $('input').val() !== '' ){ return "It looks like you have input you haven't submitted." } });