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 to the CF scene
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    target a link with the Onclick function

    I've been doing some searching and I can't seem to find what I am looking for. I hope someone can help. I am trying to target a link to an iframe window. The catch is that I need to use an onClick function in a TD tag...

    Here is an example:

    <TABLE HEIGHT="40" WIDTH="780" CELLSPACING="0" CELLPADDING="0" BORDER="1">
    <TBODY>
    <TR>
    <TD ALIGN="CENTER">HEADER 1</TD>

    </TR>
    <TR>
    <TD OnClick="location='http://www.ophil.com'" BGCOLOR="#FFFFFF">Ophil</TD>
    </TR>
    </TBODY>
    </TABLE>
    </TD>
    </TR>
    <table width="100%" border="0" cellspacing="0" cellpadding="1">
    <tr>
    <td><a name="bidframe">
    <IFRAME SRC="bid_item_instructions.html" TITLE="IFRAME" SCROLLING="no" NAME="bidpage" WIDTH="100%" HEIGHT="450" ALIGN="center" FRAMEBORDER="yes" >
    </IFRAME>
    </a></td>
    </tr>
    </table>

    </CENTER>
    </BODY>
    </HTML>


    I need the results of that onclick to appear in the iframe window I have called bidframe... Any ideas?

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    Try:
    <TD OnClick="parent.bidpage.location='http://www.ophil.com'" BGCOLOR="#FFFFFF">Ophil</TD>

  • #3
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sweet

    That works wonderfully! You are a whirlwind of mighty computing justice! Thanks so much for your help!

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    This can be achieved even without javascript.
    Code:
    <td><a href="http://www.ophil.com/" target="bidpage" style="width:100%; height:100%; display:block;">Ophil</a></td>

  • #5
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    focus

    Well I needed it to focus onto the window as well...

    Load a page into the iframe as well as jump to the iframe window... and I think I got it...

    thanks for all the help.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    Well, you can do it like this:
    Code:
    <td><a href="http://www.ophil.com/" target="bidpage" onclick="window.open(this.href, this.target).focus(); return false;" style="width:100%; height:100%; display:block;">Ophil</a></td>
    The good thing about it is the link will still work as intended even if javascript is disabled or not supported.

  • #7
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No offense, but iframes are totally 2005.


  •  

    Posting Permissions

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