Results 1 to 3 of 3

Thread: Passing Values from iFrame to Parent

  1. #1
    Join Date
    Aug 2007
    Posts
    22
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Passing Values from iFrame to Parent

    Hi I was hoping that maybe someone can help me with a little problem I'm having.

    I'm currently in the process of creating a CMS and I have also developed an uploading script to go along with it. The user will land on the Create New content page and will write/modify whatever he has to and go from there. Additionally, along on the same page, I've also include the upload script I mentioned earlier. I put the upload script inside a frame because when a form is submitted, the whole page is refreshed so I don't want to the author to lose the content they have thus so far.

    Somehow I need to pass some variable preferably Javascript into the parent documents. PHP variables will also work but I don't see how thats possible.

    Anyways something else that might or might not be useful is that I'm using the text editor TinyMCE. I don't know how many of you are familiar with TinyMCE but bascially I need the values in the following statement to be passed to parent:
    Code:
    onclick="insertAtCursor(document.getElementById('TEXTAREA'),'content to be sent')"
    The HTML strucutre currently is:

    Textarea
    IFrame
    - Upload Script

    I need to send values from upload script to textarea.

    I'm hoping that I'm making sense. If not, then please post.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    I'm a bit uncertain, but might work:
    Code:
    onclick="insertAtCursor(document.getElementById('TEXTAREA'),'content to be sent');parent.document.getElementById('id_of_the_textarea').value=this.value"
    I'm assuming that this inline (onclick) event is being called from an element that has a value property on it.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Aug 2007
    Posts
    22
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    This doesn't seem to be working. The problem is I have no experience on Javascript whatsoever. I can implement stuff but have never developed something independantly using JS. Therefore I'm not sure what you mean by an inline element having a value property.

    I really appreciate your help however. Thanks a bunch.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •