Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Detecting click on iframe

    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.

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #4
    New Coder
    Join Date
    Apr 2004
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Still not clear what you intend to do... You want to change dynamically the content of a HTML tag from iframe to parent?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •