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

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
<tr>
<td colspan="3"><iframe width=100% height="100" src="smalllistimages.asp" align=left  frameborder=0 hspace=0 vspace=0 name="ImagesView" > </iframe></td>
</tr>

d.
DstathakisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Saqib KhanSenior DeveloperCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DstathakisAuthor Commented:
Thank You it worked!!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.