Confirm Dialog

A confirm dialog is often used if you want the user to verify or accept something. When a confirm dialog pops up, the user will have to click either "OK" or "Cancel" to proceed.
Looking for a commercial license ? Keep your source code proprietary and Buy a Commercial License Today!

All of AlertifyJS animation/transition effects are disabled due to user preference that the system minimizes the amount of animation or motion it uses. See prefers-reduced-motion CSS media feature.

invokeOnCloseOff {Boolean}


Description: Gets or sets a value indicating whether closing the dialog via Close button or Dimmer should look for and trigger the action of a button having invokeOnClose set to true. Useful when you want to differentiate between closing the dialog or clicking an action that closes it.

Default: false

 alertify.confirm('invokeOnCloseOff: true')
         .set({'invokeOnCloseOff': true, 'oncancel':function() {alertify.error('Cancel')} });
  
Run

Remarks

You can use the .setting() method to set multiple values at once, Also works as a getter. Or use .get() and .set() aliases.


//get the closable setting value.
var closable = alertify.alert().setting('closable');
//grab the dialog instance using its parameter-less constructor then set multiple settings at once.
alertify.alert()
  .setting({
    'label':'Agree',
    'message': 'This dialog is : ' + (closable ? ' ' : ' not ') + 'closable.' ,
    'onok': function(){ alertify.success('Great');}
  }).show();