ua_boaz ua_boaz - 10 months ago 61
Javascript Question

bootbox 4.4 how to alert with different button label

i see in bootbox v3 documentation you can change the label by using below method
bootbox.alert(str message, str label, fn callback) Custom button text, callback invoked on dismissal,

However on version 4.4 this method does not seem to work, how can i get to use a custom button label on alert message


You can try something like this:

   size: 'small',
   message: "Your message hereā€¦", 
   callback: function(){ /* your callback code */ }
    $('.btn.btn-primary').text('Custom Text')

From the docs: bootbox.init(function): Allows the user to supply a function to be called when dialog gets initialized.