Jump to content

Pass variable to IFRAME


prudens

Recommended Posts

well you can pass value to the script inside iframe through $_GET, $_SESSION...

 

if you are calling things inside iframe on the client side, then you can use DOM.

passing variables back to main can be done using $_SESSION but i dont think this can be read from the client-side so you can use DOM here also.

  • 4 weeks later...

I have similar issue.  I need to "pull variables" from the parent page on my child page so I can use it in several places on the child page

 

I am dynamically calling iframes so can't use the GET

 

Here is what I have in the parent

 

<script type="text/javascript">function populate(){

top.frames['frame1'].document.form2.from.value = '$email';

top.frames['frame1'].document.form2.name.value = '$fname $lname';

}

  </script>

 

 

That works before if the child page is "Form" as it sets the values.  But I have children pages that are just text and I want to be able to use the NAME within the text on the child page. 

 

"$FNAME $LNAME, thanks for visiting..."

 

 

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.