I am creating JQuery dialog boxes and need the close functionality to cause a postback to the parent form (so that data changed in the popup form displays immediately on the parent screen). I have the code written and the dialog box in place. However, there is an issue. In IE, when I close the popup and the postback occurs, I get this javascript error that states "Object doesn t support this property or method" and it refers to the block of code that creates the dialog box.
Just some backgroud: The page with the popup is an aspx page with many areas that display database information that can be changed. This page uses master pages. The popup contains an iframe that I change the source of depending on what button is clicked. I was hoping to use the same dialog box and popup div for the many popup forms we have.
Here is the javascript. It is located in the $(document).ready section:
//Source of IE error
$("#popup").dialog({
bgiframe: true,
resizable: false,
height: 217,
modal: true,
autoOpen: false,
close: function()
{
$( #aspnetForm ).submit(); //Submit the parent form to cause postback
}
});
$("#BHSubmitBtn").click(function()
{
var splitChar = $("#ctl00_Main_splitCharacter");
var queueId = $("#ctl00_Main_queueId");
var siteName = $("#ctl00_Main_siteName");
var queryString = "Add" + splitChar + siteName + splitChar + queueId;
$("#popupFrame").attr( src , BusinessHoursSubForm.aspx?var1= + queryString);
$("#popup").dialog( open );
});
Here is the div I am popping up:
<div id="popup" title="Business Hours" >
<iframe id="popupFrame" src=""></iframe>
</div>
Here is the button that opens the form:
<input class="clsSubmitBtn" id="BHSubmitBtn" type="button" value="Add" />
I have tried many different ways to handle this, most ending in a javascript error (the one above) in the ui.dialog on the line that starts with:
$.widget( ui.dialog , ...)
or my javascript.
Can anyone think of why this is happening? I have gotten it to work (with the postback) but I had to strip the page of everything but the section I am working on but there isn t anything I can see that would cause it.