I'm trying to customise the text appears on the exit popup but for some reasons it is not registering the text I supplied.
window.thisPage = window.thisPage || {};
window.thisPage.isDirty = false;
window.thisPage.closeEditorWarning = function (event) {
if (window.thisPage.isDirty)
return 'Please save your current RFP draft before proceeding.' +
' - if you leave before saving, then your changes will be lost.'
else
return undefined;
};
$("form").on('keyup', 'textarea,input,select',
function () {
window.thisPage.isDirty = true;
});
$("form").submit(function () {
window.thisPage.isDirty = false;
});
window.onbeforeunload = window.thisPage.closeEditorWarning;
Can anyone check what did I miss?
Also is it possible to customise the popup with my own styling?