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 7 of 7
  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    targets a frame width out links

    Hello, I want to target a iframe with a button event, like
    onClick = ‘open this page in that iframe’

    href element has the target property, but there isn’t any of this in the button element.

    thanks

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    onclick="document.frames['framename'].location=page;"


    more or less

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    or:

    onclick="window.open('urlOfPage', 'nameOfTargetIframe')"
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The <form> element has a target attribute - if you used that with a submit button you could do it without javsacript.
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    atferraz just wanted to open a particular page in an iframe. So, submitting the form with a target is not a better approach especially if the main page is also being submitted normally (without target).
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I’m sorry. Forgot to mention that the target iframe is on a page.

    My default page has a iframe with id=name = “main”.
    I loaded a page in that main iframe.
    That page has its own iframe with id=name=”temp”. It also has a button that opens a modal Dialog window, where some data is selected.
    When that modal dialog gets closed, return an array to its handler with the selected data witch I want to send to the “temp” iframe. So, at this point the data is on client side and I want to send it with url to the server, because the action form method didn’t work at all.

    I can target the main iframe, but not the temp one.

    onclick="window.open('urlOfPage', 'nameOfTargetIframe')" opens a new window.
    onclick="document.frames['framename'].location=page;" only sees the main


    thanks

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Did you change 'nameOfTargetIframe' to 'temp'?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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