I need to have a script that warns users of leaving without saving changes
$(document).ready(function () {
$('input').change(function () {
window.onbeforeunload = function () { return "You still have unsaved changes!" };
});
});
I found this code, but it goes off when I click the submit button, which is a problem.
Any ideas how I could stop the script going off when I click submit
Thanks in advance