Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Warning icon to Bootstrap Dialog

I am using BootstrapDialog to show a warning, Where i am not able to show warning icon in the same.

Is there any way/method/key to set icon in BootstrapDailog code.

new BootstrapDialog()
     .setTitle('Warning')
     .setMessage('Warning on your action.')
     .setType(BootstrapDialog.TYPE_WARNING)
     .open();

In my case this dialog is common to all the pages. so, preferred to achieve this using script instead of HTML modal.

using: bootstrap.min.css, jquery.min.js, bootstrap.min.js, bootstrap-dialog.min.css and bootstrap-dialog.min.js.

like image 299
srinuvasan v Avatar asked Mar 02 '26 14:03

srinuvasan v


1 Answers

Title could be

String or Object(html)

You can try to set title as "ICON + title text"

.setTitle($('<span class="glyphicon glyphicon-alert">').append('Warning'))
like image 71
barha Avatar answered Mar 05 '26 04:03

barha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!