Popup Problem
-
hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }
default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }
please help me out not this issue is in IE 7 only in IE 6 its working fine sri
-
hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }
default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }
please help me out not this issue is in IE 7 only in IE 6 its working fine sri
The reason for the second window is that you are posting the form from the dialog. As you can not post a form to a dialog window, it will be posted to a new window. Return false from the CloseThisWindow function, so that the form is not posted. If you don't want the form on the main page to be posted immediately after the dialog closes, you should return false from the OpenAnotherWindow function also.
--- b { font-weight: normal; }
-
The reason for the second window is that you are posting the form from the dialog. As you can not post a form to a dialog window, it will be posted to a new window. Return false from the CloseThisWindow function, so that the form is not posted. If you don't want the form on the main page to be posted immediately after the dialog closes, you should return false from the OpenAnotherWindow function also.
--- b { font-weight: normal; }
-
hi, I have a problem with Popup window in IE7 when ever i create a popup window and i try to close tat popup window its creating a new popup window. with same url. when i clik on this second popup windwo then its closing. code: Default.aspx function OpenAnotherWindow() { var name = document.getElementById("txtName").name; WindowName="test"; var left, top; left = (window.screen.availWidth - 400)/2; top = (window.screen.availheight - 250)/2; settings= "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no, top="+ top +", left="+left+", height=250,width=400"; var id = window.showModalDialog('DialogPage.aspx?name='+ document.form1.txtName.value,WindowName, settings); document.getElementById("txtName").value=id; }
default.aspx.cs page_load btnOpenWindow.Attributes.Add("onclick", "return OpenAnotherWindow()"); dialogpage.aspx function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); return true; }
please help me out not this issue is in IE 7 only in IE 6 its working fine sri
-
Hi Ravi, Thanx for ur response.i traid those tags.even then also its opening a new popup window but the difference is parent form is getting the focus. i am sending the popup window's code (runtime) Note: in form tag action attribute is automatically assigning aaa Dialog Page function CloseThisWindow() { var myName = "Popup"; var o = new Object(); o.orglevid = "1"; o.orgname = "test"; window.returnValue=o.orgname; window.close(); }
sri
-
Hi, Thanx for ur response, but i traied all these ways and still my application is acting like tat only. is there any other way to this problem. pls inform me thanx
sri
sri_con3 wrote:
Thanx for ur response, but i traied all these ways and still my application is acting like tat only.
Then you probably did something wrong...
sri_con3 wrote:
is there any other way to this problem.
Yes, if you don't want the form submitted you can avoid using a submit button (which is what the
asp:Button
control produces). Use aninput
tag withtype="button"
instead.--- b { font-weight: normal; }
-
sri_con3 wrote:
Thanx for ur response, but i traied all these ways and still my application is acting like tat only.
Then you probably did something wrong...
sri_con3 wrote:
is there any other way to this problem.
Yes, if you don't want the form submitted you can avoid using a submit button (which is what the
asp:Button
control produces). Use aninput
tag withtype="button"
instead.--- b { font-weight: normal; }
-
hi, thanx for your response I checked every thing in my code. It is working fine in IE6 but when it comes to IE7 its givin theis problem. Is there any alternative for it. i have to use tat asp:button control not the input control
sri