Jump to content

[SOLVED] Passing info to the parent window


TEENFRONT

Recommended Posts

Hey everyone,

 

I am currently half way through creating a new article manager to manage my site reviews etc. I have ben working hard and over the past 24 hours iv managed to do this ( + more but this is the important stuff )

 

Add-Review.php

This page has a "Click here to add image" link poping up add-image.php

 

Add-image.php

This page has a php upload image script, once an image has been uploaded, you press "Close" button and the uploaded file URL, Size, and other details, are passed back to the parent window ( add-review.php ) and are displayed in input text fields.

 

Im really wanting to ditch text fields and forms to just display the info, but i can only seem to find help with transfering values back to the parent window using forms and text fields, i just want plain text.

 

So question...

 

Is there a way to transfer text from a text box in the pop up window, to the parent window but in standard html..so i can use it for updating say.. a link tag, or an image tag etc.

 

Fank Yuuuu!!

Link to comment
Share on other sites

in the parent window:

URL: <span id="showurl"></span>

in the opened window:

<script>
    window.opener.document.getElementById('showurl').innerHTML = '**the url **';
</script>

have not tried it but it should work, tell me if it does.

 

Hi

 

Thats great, thanks alot for that. How would i go about updating the url of a a href tag or the src of an image tag? like...

 

<a href="transferred link">transferred title</a>   or
<img src="transferred image src" />

Link to comment
Share on other sites

Solved!

 

Found a little javascript that does the trick. here it is if anyone else reads this!

 

<script langauge="javascript">
function movepic(img_name,img_src) {
opener.document[img_name].src=img_src;
}
</script>

 

When you run this function, it replaces the img src vale of img_name and updates the image on the page accordingly.

Link to comment
Share on other sites

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.