Amit Dhamu

Software Engineer

Modal Dialog Popups

The javascript alert() feature is a pretty naff looking confirmation popup. Using the jQuery UI plugin, you can create custom dialog boxes to match your CSS and design.


// Create an empty div
<div id="dialog"></div>

// Create a trigger
<a id="launchConfirm">Launch Confirm Box</a>


// Function
function launchConfirm(title, msg) {
        minWidth: 100,
        minHeight: 100,
        title: title,
        resizable: false,
        modal: true,
        buttons: {
            "OK": function() {
             return true;
            Cancel: function() {
            return false;

// Usage
$("#launchConfirm").live("click", function() {
    return launchConfirm("Title of Popup", "Popup Description");

You will need to ensure that you have jQuery and the jQuery UI running on your site for this to work.

popup / dialog / jquery / jquery ui

← Error Document Target By Attribute →