Bootstrap Confirm is a jQuery plugin based on Bootstrap Modal to create a confirmation dialog system.
The plugin can be triggered by data-toggle="confirm"
attribute, like bootstrap standard components. Supports either link redirections and form submitions.
<form>
<button class="btn btn-default"
data-toggle="confirm"
data-title="Wait!"
data-message="Are you sure?"
data-type="success">
Confirm Form Submition
</button>
</form>
<a href="#"
data-toggle="confirm"
data-title="Wait!"
data-message="Are you sure?"
data-type="danger">
Confirm link
</a>
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-
, as in data-title=""
.
Name | type | default | description |
---|---|---|---|
title | string | 'Confirm' | Represents the title of dialog modal |
message | string | 'Are your sure?' | The confirmation message |
type | enum | success | info | warning | danger | default | Sets the colors on dialog template |
template | html | '<div class="modal" ...' | Is the template for the dialog modal, it can be changed for diferent modal templates |