Modal PoPUp Window

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 ='ChildWin.html','name','height=400,width=850,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi mi_cky,

Maybe this can help.
There are a lot of answers on the Internet too. Try Googling on "javascript popup modal"

Hope this helps
mi_ckyAuthor Commented:
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.

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.

Try this.. add to parent page

window.onfocus = new Function('if (childWin && !childWin.closed) { childWin.focus() } ');
on Internet Explorer u can use window.showModalDialog
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.