• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Question about javascript

I'm working with DOM here. I've assigned a select box with an id. I can easily do getElementById on it on the current page. My problem however is that I also have a function call creating a new php page using the function "window.open". In that new page I wish to modify the elementsfrom the parent page.

I have tried accessing it in different ways.

for example.

var test = parent.document.getElementById('selectbox');

I get as response.

Would anyone have any idea how to pass elements from the "parent" page to the "child" page?
 
so your new window (opened via window.open javascript) has a click action that will modify a form element on the parent?

try
window.opener.document

if you're setting a select box on the opener page, it'd be
window.opener.document.form_name.select_box_name.selectedIndex = varpassedtofunction;
 
Originally posted by: troytime
so your new window (opened via window.open javascript) has a click action that will modify a form element on the parent?

try
window.opener.document

if you're setting a select box on the opener page, it'd be
window.opener.document.form_name.select_box_name.selectedIndex = varpassedtofunction;

I'll be testing this out this afternoon. If this works. THANK YOU!!!!

Heck, even if this doesn't work, thank you for giving me something to try out.

I know in my original description I was actually missing pertinent data. Must of been really tired.
 
Back
Top