Trying to pass querystring from Iframe within parent base onclick!!

Posted on 2004-10-23
Last Modified: 2010-08-05
I have a updatedoctor1.asp where I call on an Iframe and I populate the Iframe with all of my images I pulled down from a folder. What I trying to do is when a user clicks on a certain image I would pass the name of the image into a text box I would then pass back to my table. What's happen is I'm having problems passing the name back to the updatedoctor1.asp  page.

What I thought would work was onclick="PopulateTextBox('<% response.write(s)%>')"><img src="<% response.write(lcVariable)%>">

<script language="JavaScript">
   function PopulateTextBox (lcInvValue){
     var name = lcInvValue;
      document.myform.myTextBox.value = name;

I'm not sure how or where to place myTextBox in order to get the Name value.

The Iframe is in a document call updatedoctor1.asp
<td colspan="3"><iframe width=100% height="100" src="smalllistimages.asp" align=left  frameborder=0 hspace=0 vspace=0 name="ImagesView" > </iframe></td>

Question by:Dstathakis
    LVL 23

    Accepted Solution

    if the Textbox is in main document then update its content by doing this

    parent.document.myform.myTextBox.value = name;
    (Means myTextBox is a textbox within main Document, and you clicked on the image within IFRAME).

    and to update something within IFRAME from main document then

    document.myFrame.myform.myTextBox.value = name;
    (Where myFrame is the name of IFrame and text box is within IFRAME).

    Good Luck

    Author Comment

    Thank You it worked!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Learn The Basics of Ethical Hacking & Pen Testing

    Computer and network security is one of the fastest growing and most essential industries in technology, meaning companies will pay big bucks for ethical hackers. This is the perfect course to leap into this lucrative career, learning how to use ethical hacking to reveal ...

    Suggested Solutions

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    877 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now