Bug 14473

Summary: Warning about unsaved changes in cataloging
Product: Koha Reporter: Vitor Fernandes <vfernandes>
Component: CatalogingAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P3 CC: katrin.fischer, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14754    
Bug Blocks:    

Description Vitor Fernandes 2015-06-29 17:06:57 UTC
Add a warning about unsaved changes when exiting the cataloguing (addbiblio.pl) page.

http://stackoverflow.com/questions/11844256/alert-for-unsaved-changes-in-form

Possible code:

var unsaved = false;

$(":input").change(function(){ //trigers change in all input fields including text type
    unsaved = true;
});

function unloadPage(){ 
    if(unsaved){
        return "You have unsaved changes on this page. Do you want to leave this page and discard your changes or stay on this page?";
    }
}

window.onbeforeunload = unloadPage;
Comment 1 Katrin Fischer 2020-01-07 22:38:53 UTC
The advanced editor does this already - so it might be nice to have the same on the normal editor.