0

Can I create bootstrap buttons on the fly using the javascript?

for example in jQuery UI, you can do something like this:

JQ("#dialog_component").dialog({
    bgiframe: true,
    draggable:  false,
    autoOpen: false,
    modal: true,
    show: 'fade',
    position:  'top',
    hide: 'fade',
    width:  500,
    resizable: false,
    buttons: btns,  // these would be the translated buttons

});

I want to pass this btns variable as buttons in a bootstrap modal, like I do in jQuery UI. But from the documentation it seems there isn't something like that. Is there any workaround for this?

Dan
  • 9,391
  • 5
  • 41
  • 73
uday
  • 8,544
  • 4
  • 30
  • 54
  • I would look at [Bootbox](http://bootboxjs.com) or [Bootstrap3-Dialog](http://nakupanda.github.io/bootstrap3-dialog/) to make life easy.... – mccannf Sep 03 '14 at 20:03
  • It's pretty straightforward to implement this yourself with a little JavaScript. – cvrebert Sep 04 '14 at 00:45
  • possible duplicate of [Passing specific value to modal from dynamic buttons](http://stackoverflow.com/questions/24124408/passing-specific-value-to-modal-from-dynamic-buttons) – Paul Sweatte Feb 20 '15 at 22:10

1 Answers1

0

BootBox does this for you, and has buttons option.

Wojtek Kruszewski
  • 13,940
  • 6
  • 38
  • 38