JS: detect unsaved changes in a form