Afternoon guys, wonder if I can get some assistance with some JavaScript I need, unfortunately my worst language.
I have a large form that needs to prompt the user to save before leaving the page, if they have edited any of the fields inside it.
Here is what I have thus far, and would like to keep it in the same format if possible:
Code:
function do_unload(){
if() {
confirm('Changes have been made to this page. Do you wish to save them?');
document.forms.frmlog.pAction.value='SAVE';
document.forms.frmlog.submit();
}
}
Code:
<body onUnload="do_unload()">
</body>
Basically, I just want to determine what inputs and selects have been changed since the page loaded, and have the logic for this in the IF statement, if that makes sense.
Thanks in advance.