# JavaScript confirm() Replacement

DayPilot for JavaScript - AJAX Calendar/Scheduling Widgets for JavaScript/HTML5/jQuery/AngularJS

# DayPilot.Modal.confirm()

Read more in the JavaScript confirm() Replacement tutorial.

Hello, World!

    DayPilot.Modal.confirm("Are you sure?").then(function(args) {
        console.log(args.result);
    });

Run
CSS Theme ("modal_flat")

    DayPilot.Modal.confirm("Are you sure?", { theme: "modal_flat" }).then(function(args) {
        console.log(args.result);
    });

Run
CSS Theme ("modal_rounded")

    DayPilot.Modal.confirm("Are you sure?", { theme: "modal_rounded" }).then(function(args) {
        console.log(args.result);
    });

Run
Yes/No

    DayPilot.Modal.confirm("Are you sure?", { okText: "Yes", cancelText: "No" }).then(function(args) {
        console.log(args.result);
    });

Run
Result handling

    DayPilot.Modal.confirm("Hello, World!")
        .then(function(args) {
            if (args.result) {
                DayPilot.Modal.alert("You clicked OK.");
            }
            else {
                DayPilot.Modal.alert("You canceled the modal dialog.");
            }
        });

Run