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

Dstathakis used Ask the Experts™
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>

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior Developer
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


Thank You it worked!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial