3

I add a button in the footer and I don't want that the modal close when I click on it. I tried preventDefault but it doesn't work..

dialog.find('.modal-footer').append('<button type="button" class="btn btn-primary">Display</button>')

I use bootbox.

Thank you.

Mercenaire
  • 206
  • 1
  • 14

1 Answers1

5

I found the solution. I added the button like this.

buttons: {            
        success: {
            label: "Display",
            className: "btn-primary",
            callback: function () {
                return false;
            }
        }

return false

in callback prevent the closing.

Thank you.

Mercenaire
  • 206
  • 1
  • 14