Avijeet Ghosh Avijeet Ghosh - 5 months ago 57
jQuery Question

Bootstrap Modal closing when any modal inside is closed

I am using basic bootstrap modal inside which there is a summernote text area.
Problem is when I click on the insert picture button in summernote, it again opens a modal to choose the picture, but if I click on the modal close button of the summernote picture modal without choosing the picture, it closes the main modal too.

I don't want to close the main modal when modal close of the picture modal is clicked. Any help would be appreciated....

Answer
  • Check that these modals do not share the same id attribute
  • Also check that they do not share the same name attribute
  • you can give them separate names manually (like numbers: modal1)
  • you can also name them automatically with your server-side language when creating them, or with JavaScript upon load, but remember to reference these names correctly in the references, buttons & functions that close them.
Comments