Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.