@@ -, +, @@ --- .../prog/en/modules/members/memberentrygen.tt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1256,6 +1256,7 @@ var LABEL_SET_TO_PATRON = _("Set to patron"); var LABEL_AGE = _("Age"); var MSG_MESSAGING_DFEAULTS = _("Change messaging preferences to default for this category?"); + var MSG_PATRON_MODIFIED = _("You made some modification, are you sure you want to leave this page?"); [% IF quickadd && opadd && !check_member %] $(document).ready(function () { @@ -1290,6 +1291,21 @@ }); [% END %] + $(document).ready(function () { + $("#entryform :input").change(function() { + $("#entryform").data("modified", true); + }); + + $("#entryform").submit(function(){ + $(this).data("modified",false); + }); + + window.onbeforeunload = function (e) { + if ($("#entryform").data("modified")) { + return MSG_PATRON_MODIFIED; + } + }; + }); [% Asset.js("js/members.js") | $raw %] [% Asset.js("js/messaging-preference-form.js") | $raw %] --