Pop-up Modal Window

M

magix

Hi,

My popup window (Modal) target is not working.

Page1.asp
========
I have javascript:

function PopNewWin(url)
{
if (window.showModalDialog) {
window.showModalDialog(url,"PopupWin","dialogWidth:500px;dialogHeight:150px"); } else { window.open(url,'PopupWin','height=150,width=500,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes'); }}and<a href="javascript:popNewWin('Page2.asp')">Popup Link</a>Page2.asp=======i have a form with POST method displayed, of which the target window isPopupWin, which is the current one.<%if request.form("action")= 1 then%> something here after the form post...<%else%> <form action="Page2.asp" method="post" onSubmit="returnValidateForm(this)" enctype="multipart/form-data" target="PopupWin"> <input type="hidden" name="action" value="1"> ... ... <input type="submit" id="button1" value="Click to Submit"><%end if%>I suppose, that since the modal pop window name is PopupWin, then if in theform post , i specify the target as the same,then after submit, it should use back the same window, instead of openinganother new one, which is what happen now.How can I make it that after submit, it will use back the same window frame.Thank you.
 
M

magix

magix said:
Hi,

My popup window (Modal) target is not working.

Page1.asp
========
I have javascript:

function PopNewWin(url)
{
if (window.showModalDialog) {
window.showModalDialog(url,"PopupWin","dialogWidth:500px;dialogHeight:150px");
} else {
window.open(url,'PopupWin','height=150,width=500,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no
,modal=yes'); }}and<a href="javascript:popNewWin('Page2.asp')">Popup
Link</a>Page2.asp=======i have a form with POST method displayed, of which
the target window isPopupWin, which is the current one.<%if
request.form("action")= 1 then%> something here after the form
post...<%else%> <form action="Page2.asp" method="post"
onSubmit="returnValidateForm(this)" enctype="multipart/form-data"
target="PopupWin"> <input type="hidden" name="action" value="1">
... ... <input type="submit" id="button1" value="Click to
Submit"><%end if%>I suppose, that since the modal pop window name is
PopupWin, then if in theform post , i specify the target as the same,then
after submit, it should use back the same window, instead of
openinganother new one, which is what happen now.How can I make it that
after submit, it will use back the same window frame.Thank you.


ok I solved it by placing:
<Script>window.name = "PopupWin";</script>

at the head of the Page2.asp
 

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

No members online now.

Forum statistics

Threads
473,928
Messages
2,570,068
Members
46,513
Latest member
JacklynMcC

Latest Threads

Top