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:

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

Configure

Configure your confirmModal via Javascript :

$('#myLinkToConfirm').confirmModal({
    confirmTitle     : 'Custom please confirm',
    confirmMessage   : 'Custom are you sure you want to perform this action ?',
    confirmOk        : 'Custom yes',
    confirmCancel    : 'Cutom cancel',
    confirmDirection : 'rtl',
    confirmStyle     : 'primary',
    confirmCallback  : defaultCallback,
    confirmDismiss   : true,
    confirmAutoOpen  : false
});

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.