JS code for ignoring related doctypes to allow cancel of doc form

Hello there! I’m a newbie. Can anyone help me with the problem in ignoring related doctypes so that it will allow the user to cancel a document or a data? Any ideas and tutorial is a big help to me thank you!