I'm working on a mobile app (hybrid using phonegap) and have a screen where the user can enter data. The screen has 2 options in the top header bar - either use the top-left button to cancel the changes or use the top-right button to save the changes. Either way they will be navigated back to the previous screen.
What I'd like to know is if there's a preferred way of handling the click of the cancel button in terms of unsaved changes. It seems there are a couple of options:
- Prompt that changes will be lost if they continue, with the option to cancel and not go back.
- Prompt to confirm whether or not to save changes.
- Don't prompt but this option seems too risky.
Perhaps I'm thinking about this the wrong way and back-and-save (if dirty) should be the default action for the top-left button. And the top-right button should allow for a revert or delete option. The intention is that the top-right will also have a more-options button to show a popover of extra actions...