Sometimes, when a modal appears you donot want to be hidden if you clicked outside it in the gray area around it in the whole page. to prevent that behavoir, Use the following small code to prevent all modals from this action:
This snippet will teach you how to prevent modal close on clicking outside the bootstrap modal