dialog does not open as a pop up window
Hello there,
I am having a problem with the dialog plugin.
I am calling it when I click a button, it opens the url, but as an inline and not as a popup window.
My code:
- $(document).ready(function() {
$('#sandwich').each(function() {
$('#sandwich').click(function() {
var day = $('#day').val();
var month = $('#month').val();
var year = $('#year').val();
var customerId = $('#customer').val();
var customerName = $('#customerName').val();
var phone = $('#phone').val();
var time = $('#time').val();
var comments = $('#comments').val();
var paid = 0;
if ($('#paid').is(':checked')) { paid = 1; }
var qry = 'day=' + day + '&month=' + month + '&year=' + year + '&customer=' + customerId + '&phone=' + phone + '&time=' + time + '&paid=' + paid + '&comments=' + comments;
var $dialog = $('<div></div>')
.load('orderSandwich.php?' + qry)
.dialog({
autoOpen: false,
title: 'Sandwich Order',
width: 600
});
$dialog.dialog('open');
return false;
});
});
});
The html button:
- <div id="sandwich" style="float: right; padding-top: 5px; padding-right: 5px;"><button id="sandwich" class="button">Sandwich Order</button></div>
Can someone help me and tell me what am I doing wrong?
Thanks,
Sigal