Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open a Link to another Frame in HTML?

UPDATE: It is still Not working. The Links are clickable but they are not taking where its suppose too. Example, From Frame 1 when You click on the Contact information, it should open that in Frame 3. From Fame 1, when you click on Hours of Operation, it should display the Hours of Operation in Frame 3.

UPDATE 2: After adding # sign...When I click on the Contact Information..It would display THE FRAME 1 in FRAME 3 and get Rid of what I had in FRAME 3. Which is not I am Suppose to Do.

So..I have four Frames. The code for those frames is displayed below. So It will display four Different frames in one page. The Picture of that is also displayed. enter image description here

<!DOCTYPE html>
<html>

    <head> 
        <title> A4 - HTML Frames - Jainamkumar Patel </title>
    </head>

    <frameset cols = "20%,50%">
        <frame src = "frame1.html">

    <frameset rows = "30%,30%">
        <frame src = "frame2.html">

    <frameset cols = "25%,25%">
        <frame src = "frame3.html" name = "frame1">
        <frame src = " ">

        </frameset>
    </frameset>
 </frameset>

</html>

Now This is what I want to Do:

Pane 2 contains hyperlinks to contact information, services, hours of operation, product descriptions. There are to be at least 3 links to the product descriptions.
Pane 3 of the browser window holds the pages describing contact information, services, hours of operation, to which appropriate links refer.

Frame 1 Code:

<!DOCTYPE html>
<html>

    <head> 
        <link rel = "stylesheet" href =  "HTML_Style_Sheets.css">
    </head>

    <body> 

        <h1> CRC Software Solutions </h1>
        <h2> About Us </h2>

        <p><a href = "#frame3.html" target = "frame1"> Contact Information </a></p>
        <p><a href = "#frame3.html" target = "frame1"> Services </a></p>
        <p><a href = "#frame3.html" target = "frame1"> Hours of Operation </a></p>
        <p><a href = "#frame3.html" target = "frame1"> Product Descriptions </a></p>

        <ol> 
            <li> Product 1 Description </li>
            <br>
            <li> Product 2 Description </li>
            <br>
            <li> Product 3 Description </li>
        </ol>

    </body>

</html> 

Frame 3 Code:

<!DOCTYPE html>
<html>

    <head> 
        <link rel = "stylesheet" href = "HTML_Style_Sheets.css">
    </head>

    <body>

        <h1> Contact Information </h1>

        <p> 4837 Blind Bay Road <br>
            Celista, BC V0E 1L0 <br>
            250-955-5462 <br>
        </p>

        <p> For any difficulties or questions you might have regarding out website and services please contact our Support Team. </p>

        <p> [email protected] </p>

        <h1> Hours of Operation </h1>
    </body>

</html>

So I want to do is to Link the Contact Information to the Frame 3. So that when you click on CONTACT INFORMATION from Frame 1..it should open that in Frame 3 . Same thing for Services. Once the services is Clicked in frame 1...it should display Services in Frame 3. (I still have to do the Services part but I have done the Contact Information part).

The problem: When i run it..and click on the Contact Information..It opens the FRAME3 in a new tab which is not what I have to do.

Yes I know its Huge but Please help me out with this.

Thank You.

like image 861
J patel Avatar asked Nov 12 '16 17:11

J patel


1 Answers

In the <frame> tags inside the <frameset> tag you have to use the attribute name for the frames, not ID, like this

<frameset cols = "20%,50%">
     <frame src = "frame1.html" name = "frame1">
<frameset rows = "30%,30%">
    <frame src = "frame2.html" name = "frame2">
<frameset cols = "25%,25%">
    <frame src = "frame3.html" name = "frame3">
    <frame src = " ">

Then your link (inside frame1) should be like this:

<a href = "frame3.html" target = "frame3">

(P.S.: If you need an ID, you can use both name and ID)

like image 149
Johannes Avatar answered Oct 11 '22 20:10

Johannes