Connecting Tech Pros Worldwide Forums | Help | Site Map

Updating main page with iframe

Newbie
 
Join Date: Mar 2007
Location: England
Posts: 3
#1: Mar 1 '07
Hello,
I have an iframe inside my main page, this main page has a form with several textareas.
I would like that when I click on a link in my iframe, a text associated with this link would insert into the textarea that has the focus in my main page.

Is this possible? this will be sort of a clipboard facility for my users.

your help is very much appreciated.
thanks

Newbie
 
Join Date: Mar 2007
Posts: 4
#2: Mar 2 '07

re: Updating main page with iframe


Quote:

Originally Posted by ccyarm

Hello,
I have an iframe inside my main page, this main page has a form with several textareas.
I would like that when I click on a link in my iframe, a text associated with this link would insert into the textarea that has the focus in my main page.

Is this possible? this will be sort of a clipboard facility for my users.

your help is very much appreciated.
thanks

If I understand right your problem, in my opinion this is the solution:

<textarea id='mytextarea'></textarea>
<iframe>
<a href="#" onclick=myfunction('this is my text')>mylink</a>
</iframe>
<script>
function myfunction(text)
{
document.parent.getElementById('mytextarea').inner HTML=text;
}
</script>
Reply