$('#dialog').dialog({ autoOpen: false, width: 600, buttons: { "Button1": function() { // Perl code here }, "Button2": function() { // Perl code here } } });