Solved

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

Posted on 2004-08-21
3
24,540 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now