Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

frame page

Status
Not open for further replies.

patweb

Programmer
Apr 17, 2003
174
BE
From my index.htm I have a drop-down menu.
The client select in this a page.
He jumps to the frame where the page is in.
I want that he shows in this mainframe the selected page : left(frame) is the directory (same as menu content) and rightframe should be the selected page page.htm.

index.htm drop-down menu
page1
page2
page3

function javacript
case "page1" :
parent.location.href = "frm/frame1.htm" = ok
parent.frame1.rechts.location.href = "nl/page2.htm" ?
break;

he shows the frame but not the selected page (he used the default page as defined in the frame).
 

Is the target frame called frame1 or rechts? Do you have nested framesets? Can you post your frameset code?

Either way, try replacing this:

Code:
parent.frame1.rechts.location.href = "nl/page2.htm"

with one of these two lines:

Code:
parent.frame1.location.href = "nl/page2.htm"
parent.rechts.location.href = "nl/page2.htm"

Hope this helps,
Dan


The answers you get are only as good as the information you give!

 

Code:
<html>
<head>
</head>
<frameset cols="18%,82%" framespacing="0" frameborder="0" cols="*">
  <frame name="left" src="frmdir.htm" target="rechts" scrolling="no" scrolbar="no">
  <frame name="rechts" scrolling="auto" src="nl/page2.htm"
  target="rechts">
  <noframes>
  <body>
  </body>
  </noframes>
</frameset>
</html>

Code:
 	case "W01" :
		parent.location.href = "frm/frame1.htm"
		parent.rechts.location.replace = "nl/page2.htm"
		break;
	case "W02" :
 
the target frame is frame1 and the next target is a page in this frame1, namely the page name selected in the menu. He reach frame1 but show the default page at the right side of this frame and not the page I want.

If someone know how to, it would please me enormously.

regards, pat
 

You don't have a frame called frame1. You also have target attributes in your frame elements - these are not valid, so you should remove them.

Did you try using this:

Code:
parent.rechts.location.href = "nl/page2.htm"

Can you also post your JS and HTML code - edspecially the stuff regarding the select box and the onchange event.

Dan


The answers you get are only as good as the information you give!

 
I have targed atttibutes because the frame itself works independent before. Left part was the directory and right the page. clinking left change the value (page) in the right part of the frame. This works, but now I want to reach this form another page (index.htm).

Code:
<html>

<head>
<title>New Page </title>
<link rel="stylesheet" href="m_css/cssdirleft.css">
<base target="rechts">
</head>
<script language="javascript">

<!--
function goTo()
{

var getal = document.form1.selectned.value;

switch (getal)

	{

 	case "W01" :
		parent.location.href = "frm/frmnl.htm"
		parent.rechts.location.href= "nl/page1.htm"
		break;
	case "W02" :
		parent.location.href = "frm/frmnl.htm"
		parent.rechts.location.href= "nl/page2.htm"
		break;
	case "W03" :
		parent.location.href = "frm/frmnl.htm"
		parent.rechts.location.href = "nl/page3.htm"
		break;
	}

}


//-->

}


//-->


</script>


<body>

<form name="form1" method="post" action align="left">
  <table border="0" cellpadding="0" cellspacing="0" width="100%"
  style="border-left: medium none rgb(255,167,79)">
    
	<select name="selectned" onChange="goTo()">
        <option class="one" value="W00">&nbsp;&nbsp;&nbsp;&nbsp;NED</option>
        <option value="W01">01.PRESENTATION</option>
        <option value="W02">02.MEMBERS</option>
        <option value="W03">03.POINTS</option>

      </select>


  </table>
</form>
</body>
</html>
 
The whole problem, and need for Javascript, would go away if you just coded 3 framesets.

A couple of problems with your framesets i just made suggested changes rather than explaining them:

Code:
Frameset 1
<frameset cols="18%,82%">
<frame name="left" src="frmdir.htm"
 scrolling="no" frameborder="0">
<frame name="rechts" src="nl/page1.htm"
 scrolling="yes" frameborder="0">
</frameset>

Frameset 2
<frameset cols="18%,82%">
<frame name="left" src="frmdir.htm"
 scrolling="no" frameborder="0">
<frame name="rechts" src="nl/page2.htm"
 scrolling="yes" frameborder="0">
</frameset>


Frameset 3
<frameset cols="18%,82%">
<frame name="left" src="frmdir.htm"
 scrolling="no" frameborder="0">
<frame name="rechts" src="nl/page3.htm"
 scrolling="yes" frameborder="0">
</frameset>

Hope that helps!

Clive
 
sorry, but not a good id, instead of 4 frames I should use 100 frames (4*25 pages). And the frames itself works fine, left click and right the page. This won't work anymore if each frame has only one page.
It should be possible with a little function or something like that. If tried document wright but can you get a static frame with left the dir and right only one page.
 
its not the best way (much much larger code) but ok, i used your suggestion in my javascript (not seperated frame files), I create my frames via javascript with document.write. But of cours instead of two lines for each case I need now 10.
 
And the frames itself works fine, left click and right the page. This won't work anymore if each frame has only one page.

I am assuming that the left frame uses links to fill the right frame. If this is true this should work.

Frameset 1
Left frame
<a target="rechts" href="nl/page2.htm"

In fact you can load any page into the right frame with this method. Framesets don't know how many frames they have.




Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top