Jump to content

form submit target and getelementid


ThunderAI

Recommended Posts

I have a form in an iframe:

 

action="_iframe_submitpoint_sn.php" method="post" target="formresults">

 

target="formresults" is an iframe within the iframe.  On "_iframe_submitpoint_sn.php" I have a javascript function that is suppose to change the content of a field outside of the first iframe.  What should that .GetElementID look like?

 

I've tried Top, parent, but I can't seem to find the magical combination.

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/241635-form-submit-target-and-getelementid/
Share on other sites

Since you are in an iframe within an iframe, you would need to create a few functions

 

in the main page (outside the iframes), create a function that update the value

ie function update_val(val) { document.getElementById('my_id').value = val; }

 

in the first iframe window, you'll need to create a function that call the parnet update_val function. (function something(val) {parent.update_val(val);})

 

In the last iframe, you'll need to make a function that call that function. You also try to call parent.parent.update_val(val) from the inside iframe.

 

 

Since you are in an iframe within an iframe, you would need to create a few functions

 

in the main page (outside the iframes), create a function that update the value

ie function update_val(val) { document.getElementById('my_id').value = val; }

 

in the first iframe window, you'll need to create a function that call the parnet update_val function. (function something(val) {parent.update_val(val);})

 

In the last iframe, you'll need to make a function that call that function. You also try to call parent.parent.update_val(val) from the inside iframe.

 

 

 

Can one assume that Parent.Parent.document.getelementbyID would not work and it has to be done via a function?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.