quite an interesting problem. Below is the pseudo code which may help you to tackle this problem
you will have to bind a jquery click event on your menu list which will check "is any field modified in current opened form"
$(function(){
$('#new1 li').on('click',function(){
$("form input[type=text]").each(function(){
var input = $(this);
if(input.val() != '')
return confirm('are you sure want to leave this page');
else
return true;
});
});
})
PS: you may have to check the syntax online this is just a pseudo code