Solved

ASP.NET (VB.NET) - Pop Up Window Issue

Posted on 2004-08-21
3
24,546 Views
Last Modified: 2013-11-28
Hi,

I am having a main window and I am opening a pop-up window from this main window. From the pop-up window I need to open another pop-up as a modal window. When I open this model window all controls in the scond pop-up vanishes and once the user enters  the value in the third pop-up window the controls in the second pop-up window regains all its control. I don't want to refresh the second pop-up after the modal dialog is closed. That I can do with windows.opener.location.href. I want the second pop-up not to loose the controls when another modal dialog is opened from the same.

Thanks,
Prasanna
0
Comment
3 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 100 total points
ID: 11862464
Hi

Are you talking among the lines of this:?

Main Page
main.html
==============
<html>
<head>
<title>Test Main Page</title>
</head>
<body>
<input type="button" value="Launch First Popup" onclick="window.open('firstPopup.html','','width=400,height=400');">
</body>
</html>

First Popup Window
firstPopup.html
==============
<html>
<head>
<title>Test First Popup Window</title>
<script language="javascript">
<!--

//Below function will not hide launchModal button because if the user has a popup blocker, you're screwed
function hideControls() {
   var alltags = (document.getElementsByTagName) ? document.getElementsByTagName("*") : (document.all) ? document.all : document.layers;
   for (var i=0;i<alltags.length;i++) {
      if (alltags[i].name=="launchModal" || alltags[i].tagName=="BODY" || alltags[i].tagName=="HTML") {
         continue;
      } else {
         (document.layers) ? alltags[i].visibility="none" : alltags[i].style.visibility="hidden";
      }
   }
}

function showControls() {
   var alltags = (document.getElementsByTagName) ? document.getElementsByTagName("*") : (document.all) ? document.all : document.layers;
   for (var i=0;i<alltags.length;i++) {
      (document.layers) ? alltags[i].visibility="show" : alltags[i].style.visibility="visible";
   }
}

// -->
</script>
</head>
<body>
<input type="button" value="Launch Modal Dialog" name="launchModal" onclick="hideControls();window.showModalDialog('modalPopup.html',window);showControls();"><br>
NOW, A LOT OF TEST STUFF
<p>&lt;p&gt;THIS IS A <P> TAG!&lt;/p&gt;</p>
<div>&lt;div&gt;THIS IS A <DIV> TAG!&lt;/div&gt;</div>
<span>&lt;span&gt;THIS IS A <SPAN> TAG!&lt;/span&gt;</span><br>
<input type="button" value="THIS IS A BUTTON!"><br>
<input type="submit" value="THIS IS A SUBMIT BUTTON!"><br>
<input type="reset" value="THIS IS A RESET BUTTON!"><br>
<input type="text" value="THIS IS TEXTFIELD!"><br>
<input type="password" value="THIS IS PASSWORD!"><br>
<textarea>THIS IS A TEXTAREA</textarea>
</body>
</html>


This firstPopup.html is the brain behind this. It popups a modal window and hides all the elements on the page that have tags surrounding them (except the first button, but you can disable that, and for all text not in tags, just put <span> around them).

It uses the fact that it does hideControls, then opens the modal dialog, but because modal dialog stops Javascript on main page, when it closes, it does showControls. If you use a DHTML equivalent or a normal window, you'd need to use onunload="opener.showControls();".


Regards,
Zyloch
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This story has been written with permission from the scammed victim, a valued client of mine – identity protected by request.
Marketing can be an uncomfortable undertaking, especially if your material is technology based. Luckily, we’ve compiled some simple and (relatively) painless tips to put an end to your trepidation and start your path to success.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question