Confirm Bootstrap

The confirm modal made with Twitter Bootstrap

View project on GitHub

About confirm

A streamlined, but flexible, take on the traditional javascript confirm functionnality with only the minimum required functionality and smart defaults.

Download file

Static example

Below is a statically rendered confirm.

Live demo

Toggle a confirm via javascript by clicking the button below. It will slide down and fade in from the top of the page.

Launch demo confirm modal

Using confirm-bootstrap

Call the confirm via javascript:

  1. $('#myLinkToConfirm').confirmModal();

Configure

Configure your confirmModal via Javascript :

  1. $('#myLinkToConfirm').confirmModal({
  2. confirmTitle : 'Custom please confirm',
  3. confirmMessage : 'Custom are you sure you want to perform this action ?',
  4. confirmOk : 'Custom yes',
  5. confirmCancel : 'Cutom cancel',
  6. confirmDirection : 'rtl',
  7. confirmStyle : 'primary',
  8. confirmCallback : defaultCallback,
  9. confirmDismiss : true,
  10. confirmAutoOpen : false
  11. });

You can use HTML5 data attributes to configure the confirm modal:

Name type default description
data-confirm-title string Please confirm Title of the confirm modal.
data-confirm-message string Are you sure you want to perform this action ? Message of the confirm modal.
data-confirm-ok string Yes Validation button's message.
data-confirm-cancel string Cancel Cancelling button's message.
data-confirm-direction string rtl Direction for showing buttons, starting with the validation button.
data-confirm-style string primary Style of the validation button.
data-confirm-callback string defaultCallback Function to execute when validate modal..
data-confirm-dismiss boolean true If modal is dismiss when confirm.
data-confirm-auto-open boolean false If modal is automatically open when created.