Search code examples
javascriptbootbox

Bootbox and confirm message


I use only a basic confirm message, but there is no message displayed.

bootbox.confirm("Are you sure?", "No", "Yes", function(result) {
    alert("test");
  });

http://jsfiddle.net/fjd3zzdm/


Solution

  • You can use a Custom dialog:

    bootbox.dialog({
        message:"Are you sure?",
        buttons: {
          yes: { //Button Yes
            label: "Yes",
            className: "btn-success",
            callback: function(result) { //Do whatever you want here
                alert("test");   
            }
          },
          no: { //Button No
             label: "No",
            className: "btn-danger",
            callback: function() {}
          }
        }
    }); 
    

    Working Fiddle here! :)