In my previous blog I showed how to redirect a user after saving a newly created or edited list item, by using the Source parameter. A reason as of why you would want to redirect your users could be to confirm that their input has been successfully saved or to make sure that they don’t land on your list view. Whatever the reason of the redirect may be, it’ll also redirect the user to that URL whenever he hits the cancel button. While this side effect can be useful at times, it can also be very confusing.
Imagine what happens when you redirect your users to a success-page, only does the user not hit the save button but the cancel button in stead? Right, it’ll still redirect the user to the success-page! Luckily, there is a method to redirect users to a different page whenever he hits that cancel button. This method only works on SharePoint on premises however.