[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Modal PoPUp Window

Posted on 2006-04-01
8
Medium Priority
?
3,258 Views
Last Modified: 2012-08-13
Hi Guys,

I am trying to make a popup window Modal, thus to say prevent the user
from clicking on anything else until the child window is closed.
How can i achieve this with a cross browser code .  Most importantly i need to  move data bewteen both
windows, parent & child window s(var ParentWin = window.opener.document.form;)

Can someone please provide a sample of this, thanks very much in advance

function popup(){
 childWin = window.open('ChildWin.html','name','height=400,width=850,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
       childWin.moveTo(40,60);
      childWin.focus();
}
0
Comment
Question by:mi_cky
5 Comments
 
LVL 6

Expert Comment

by:Filips
ID: 16348960
Hi mi_cky,

Maybe this can help. http://javascript.about.com/library/blmodal.htm
There are a lot of answers on the Internet too. Try Googling on "javascript popup modal"

Hope this helps
Filips
0
 

Author Comment

by:mi_cky
ID: 16349096
Hi ,
I have tried the above and it deosnt seem to work, Please note, the triggering of the pop is done by selecting a value from a drop down menu list <option> </option>. The pop is still model.

0
 
LVL 6

Expert Comment

by:Filips
ID: 16349161
Here is a page with an example modal popup but it only works with IE. For what I have read it's not so easy to create a real modal window and to make it work for all browsers seems to be nearly impossible.

How the popup is triggered doesn't matter. Trigger calls JavaScript => JavaScript calls popup.

Maybe another JS guru can add some comments here.

Greetz
Filips
0
 
LVL 7

Expert Comment

by:bubbledragon
ID: 16349818
Try this.. add to parent page

<script>
window.onfocus = new Function('if (childWin && !childWin.closed) { childWin.focus() } ');
</script>
0
 
LVL 2

Accepted Solution

by:
ppedregal earned 2000 total points
ID: 16418804
on Internet Explorer u can use window.showModalDialog
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodaldialog.asp
it supports only one argument but can be an object so there is no problem on return you must use event.returValue that can be another object

on Mozilla u can use the feature "modal=yes"

apart from this options u can also use the trick explained before of returning the focus to the window when its lost
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

873 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