...

View Full Version : Detecting click on iframe



Lord_Garfield
04-29-2004, 02:28 PM
Hi all

How can i create the folowing events for the iframe element:
onclick
onfocus
onkeydown
onkeyup

I know i can use div to but I need to refresh the source.
i use allot of iframename.location.reload(true);
this is not possible with the div tag.

any idee..
also the content of the iframe is editable.

tank you.

sad69
04-29-2004, 08:55 PM
Maybe you can have the onClick within the iFrame call a function in the parent?

Just shooting that out there because I don't know what you're trying to do..

Sadiq.

Lord_Garfield
04-30-2004, 07:19 AM
I actualy need a good replacement for the not working function
<iframe id="textbox" onclick="testingfunction()"></iframe>

i use an iframe as a rich textbox.
so I use functions like
textbox.document.execommand

or textbox.document.write

and also the reload funcion.

best regards
roel.

Lord_Garfield
04-30-2004, 07:56 AM
Hi,

I forgot to mention a few things.

I created a wysiwyg editor and it uses the iframe as editable window.

but why do I need the onclick event. Well if a user clicks on the iframe and it is over let say a bold word then my bold button will be pressed in automaticaly. I know now how to check if a certain execomand is used but the examples I saw are with <div>. Unfortunatly load an excisting html page in my editor and need to refresh it from time to time.


best regars.
roel.

Kor
04-30-2004, 08:00 AM
Still not clear what you intend to do... You want to change dynamically the content of a HTML tag from iframe to parent?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum