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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top