Javascript dialog box problem


J

Jeff

I'm hoping that someone can help me. I know little javascript and only need
a very small amount in an asp.net application. I have most of it working
with one problem. I'm attempting to open a modal dialog box from a parent
window. The dialog box opens fine with the code below associated with the
parent. In the child window, I have a button with the simple self.close()
code associated with it. Obviously, I want to use the button to close the
child window (I've also tried window.close()). When the button is clicked,
the dialog box closes, but the info.aspx page is then re-displayed in
another regular window that opens. I found some reference to the problem on
the web with an explanation that it only occurs in IE after version 5, but
I've found no solution. ...and it still occurs in both IE6 and IE7.

Can someone tell me what I'm missing?

In parent window
window.showModalDialog('Info.aspx','
','dialogHeight:150px,dialogWidth:200px')

In child window
self.close()

Thanks in advance

Jeff
 
Ad

Advertisements

C

con3

Hi Jeff,
try this
in ur popup page at the <head> level mention
<script language="javascript">woindow.name="popup.aspx";</script>
<!-- Popup.aspx is ur popup window name -->
and in form tag of ur popup window set attribute target to "popup.aspx"
target="Popup.aspx"

hope this will help u
sri
 
Ad

Advertisements

J

Jeff

con3 said:
Hi Jeff,
try this
in ur popup page at the <head> level mention
<script language="javascript">woindow.name="popup.aspx";</script>
<!-- Popup.aspx is ur popup window name -->
and in form tag of ur popup window set attribute target to "popup.aspx"
target="Popup.aspx"

hope this will help u
sri

Thanks. There were actually two problems. The above was one of the problems
and the other was a left over "onblur" command that was in the wrong place
and causing seemingly random behavior.

I have it working now.

Jeff
 

Top