Jim
Jim

Reputation:

How can I get the value from a parent html page into a javascript popup page?

I have a php page where a date value is POSTed back to. From this php script, I want to forward that value to a javascript window. Can this be done?

Upvotes: 0

Views: 322

Answers (1)

gnarf
gnarf

Reputation: 106332

The opened window should have access to the parent window through window.opener from there you can access your parent document.

Try something like this in your popup window:

alert(window.opener.document.getElementById('mydate').innerHTML);

Upvotes: 1

Related Questions