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

    help me please! how to target frames with button links

    i know how to use button links...
    this is how...

    Code:
    <html>
    
    <HEAD>
    
    <script type="javascript">
    
    function goToURL() 
    { 
    window.location = "http://www.codingforums.com"; 
    }
    
    </script>
    
    </HEAD>
    
    
    <BODY>
    
    <form>
    <input type=button value="CODING FORUMS" onClick="goToURL()">
    </form>
    
    </body>
    
    </html>
    ...BUT, how do you use a button link to link to a specific frame in a webpage


    this is my frameset and index file:

    index.html
    frametop.html
    frameleft.html
    mainframe.html

    index is the file which holds the frames in a frameset
    there are 3 frames in index.html
    one at the top,
    one at the bottom, which is split into two frames.

    so how do i use a button link to ... lets say... link to www.codingforums.com, but so that the target is "mainframe.html"?

    --any help is appreciated, thankyou!

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    <form>
    <input type=button value="CODING FORUMS" onclick="parent.mainframe.location='www.codingforums.com'">
    </form>
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #3
    New to the CF scene
    Join Date
    Mar 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why are you doing all of the coding with javascript when it can be done in html by just using something like this on one line?

    <a href="http://www.codingforums.com" target="mainframe"><img border="0px" src="/images/home.png"></a>

    Take a look at www.novell-linux.com

    Is this what you are trying to do?

    Neil

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    I think the key word here is button
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #5
    New to the CF scene
    Join Date
    May 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <frame src="mainframe.html" name="main">

    <button onClick="main.location='http://www.codingforums.com'">codingforums</button>
    or
    <button onClick="parent.main.location='http://www.codingforums.com'">codingforums</button>


  •  

    Posting Permissions

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