JavaScript
--
Questions
--
Followers
Top Experts
showModalDialog
How can I control parent window from popup window?
I need by clicking on selected icon to close the window (the one that the showModalDialog opened) and to submit form from the parent window
I can't use window.open instead because I need that the popup window will remain activate or closed.
It can't be on the background!
(I familiar with <body onblur="window.focus()"> but it's not adequateness solve the problem)
I need by clicking on selected icon to close the window (the one that the showModalDialog opened) and to submit form from the parent window
I can't use window.open instead because I need that the popup window will remain activate or closed.
It can't be on the background!
(I familiar with <body onblur="window.focus()"> but it's not adequateness solve the problem)
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
try looking into parent.opener values e.g
parent.opener.document.for m1.button1 .value etc etc
parent.opener.document.for
parent.opener is undefined
OK, had it slightly wrong, here is the code that will show you how to use it.
Main.html
<HTML>
<SCRIPT>
window.open("popup.html"," Popup");
</SCRIPT>
<FORM NAME=Form1>
<INPUT NAME=Test1 TYPE=TEXT>
</FORM>
</HTML>
popup.html
<HTML>
<SCRIPT>
opener.document.Form1.Test 1.value = "Added From Popup";
</SCRIPT>
</HTML>
-Richard
Main.html
<HTML>
<SCRIPT>
window.open("popup.html","
</SCRIPT>
<FORM NAME=Form1>
<INPUT NAME=Test1 TYPE=TEXT>
</FORM>
</HTML>
popup.html
<HTML>
<SCRIPT>
opener.document.Form1.Test
</SCRIPT>
</HTML>
-Richard






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Now I see what you mean and you absolutely right but it's got nothing to do with my problem cause I can't use window.open() because that window mast remain on top until it's close.
Please read again my first question.
I'm using showModalDialog()
Please read again my first question.
I'm using showModalDialog()
What exactly is it that you want, please paste some code as I am not sure exactly what you want.
Is it you want to open a new window and that window must be in the forground untill closed.
My answer was to the first bit "How can I control parent window from popup window?".
What else do you need to do, will my code combined with <body onblur="window.focus()"> not solve the problem?
-Richard
Is it you want to open a new window and that window must be in the forground untill closed.
My answer was to the first bit "How can I control parent window from popup window?".
What else do you need to do, will my code combined with <body onblur="window.focus()"> not solve the problem?
-Richard
Richard,
That's exactly what I did wrote in the first place!!
so the answer remain NO! I can't use
<body onblur="window.focus()"> because It's doesn't force the user to close the popup window first.
I'm using showModalDialog to open that window.
but It's all already being wrote on my first request.
thanks again.
That's exactly what I did wrote in the first place!!
so the answer remain NO! I can't use
<body onblur="window.focus()"> because It's doesn't force the user to close the popup window first.
I'm using showModalDialog to open that window.
but It's all already being wrote on my first request.
thanks again.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Thank u very much!
JavaScript
--
Questions
--
Followers
Top Experts
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.