How to access popup parent window elements with JavaScript

by ebarcza 10/8/2009 10:28:00 AM
How to access popup parent window elements with JavaScript

The JavaScript code to access parent windows elements is not a complex one. Indeed, all that is needed is the code window.opener. The rest of the element can be addressed as per usual.

If you wanted to submit a form in the parent window for example, the following code would be used:

window.opener.document.myForm1.submit();

As mentioned the code window.opener will access the parent window and document.myForm1 will point to your form (in this case called myForm1) within the document, and then with the function submit(), the information from the form is sent.

Tags: ,

JavaScript

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  July 2018  >>
MoTuWeThFrSaSu
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2018

Sign in