My requirement is to open the dialoge onclick Cancel button. Once 'Cancel the Reservation' is clicked, the form should be submitted.
With the below code, I am getting the error : Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'
I have my div as :
<div id="dialog" title="Confirmation Required" style="display:none">
Are you sure about this?
</div>
Button as :
<input type="submit" id="btnCxlJob" name="btnCxlJob" value="Cancel" />
In document.Ready :
$("#dialog").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
'Cancel the Reservation': function() {
$(this).dialog('close');
document.JobConf.submit;
},
'Cancel': function() {
$(this).dialog('close');
}
}
});
$("#btnCxlJob").click(function() {
var theDialog = $("#dialog").dialog();
alert("clicked!");
theDialog.dialog("open");
});
Although I tried suggestions from other posts for this error but could not get rid of this error.Any help is hugely appreciated. Thank you