Customizable AJAX-enabled jQuery Confirmation Box Plugin - Confirm JS

Customizable AJAX-enabled jQuery Confirmation Box Plugin - Confirm JS
File Size: 7.13 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Confirm JS is an easy-to-use and highly customizable jQuery popup box plugin to create responsive, modal-style and well-designed confirm dialog boxes for getting confirmation before proceeding.

More features:

  • Lazy load support.
  • Keyboard support.
  • Custom title, content and buttons.
  • Custom trigger events.
  • Auto close after a timeout.
  • Lots of callback functions.

Basic usage:

1. Add references to jQuery library and the jQuery Confirm JS plugin's JS & CSS files into the webpage.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.confirm.js"></script>

2. Attach the confirm function to the trigger button and done.

$('.trigger-el').confirm({
  accept: function(obj) {
    alert('Confirm!');
  },
  abort: function() {
    alert('Cancel!');
  }
});

3. Customize the title, content, buttons for the confirm dialog box.

$('.trigger-el').confirm({
  title: 'Confirm Box',
  content: 'Are You Sure To Delete The Entry?',
  button_accept: 'Confirm',
  button_abort: 'Cancel',
});

4. All customization options with default values.

$('.trigger-el').confirm({

  debug: true,
  enabled: true,
  reload: false,
  container: window,
  template: null,
  title: 'Sind Sie sicher?',
  content: 'Bitte bestätigen Sie ihre Aktion mit OK, oder brechen Sie die Aktion ab mit Abbrechen.',
  button_accept: 'OK',
  button_abort: 'Abbrechen',
  on: 'click',
  input: false,
  keys: {
    // ok: 13,
    abort: 27
  },
  url: null,
  ajaxOptions: {
    method: 'POST'
  },
  lazyLoad: false,
  removeOnClose: false,

  modalClass: 'modal',

  hideAfter: null,
  hideAfterTimeout: false,

  keep_modal: false,
  custom_buttons: null,

  createForm: false
  
});

5. Callback function available.

$('.trigger-el').confirm({
  open: function(){},
  button_pressed: function(){},
  close: function(){},
  defaultAction: function(){},
  accept: function(){},
  abort: function(){},
  ajaxSuccess: function() {},
});

Changelog:

2019-02-25

2017-10-09

  • Fixed remove method.

2017-03-30

  • JS update

This awesome jQuery plugin is developed by Sioweb. For more Advanced Usages, please check the demo page or visit the official website.