gregrego
asked on
drop down link box, that must open links in Inline Frame
This is my code that i currently have for the page and i would like to force the pages to open inside of the inline frame... so plz help :P
You can view the page here: http://members.shaw.ca/greg_rego/gnbtelco/
just click the picture to enter.
<html>
<head>
<meta http-equiv="Content-Langua ge" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor. Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Telco Power & Battery :: Main Page</title>
<base target="I1">
</head>
<!-- JavaScript for the Drop Down Menu -->
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli st.options
[document.navform.navlist. selectedIn dex].value ;
location.href = loc
}
</script>
<body link="#C1C497" vlink="#C1C497" alink="#C1C497" text="#C1C497" bgcolor="#000000" background="index1.jpg" topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="650" id="AutoNumber1" height="714">
<tr>
<td width="100%" height="714" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" height="617">
<tr>
<td width="100%" height="143" colspan="3"> </td>
</tr>
<tr>
<td width="33%" height="1"></td>
<td width="34%" height="1">
<!-- Drop Down Menu! -->
<form name = "navform">
<select size="1" name="navlist" onChange="jumplink(this.fo rm)">
<option value="home.htm">Main Page</option>
<option value="about.htm">About Us</option>
<option value="services.htm">Servi ces</optio n>
<option value="portfolio.htm">Port folio</opt ion>
</select>
</form>
<p> </td>
<td width="33%" height="1"></td>
</tr>
<tr>
<td width="100%" height="423" colspan="3" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber3" height="421">
<tr>
<td width="100%" height="421" align="center" valign="top">
<iframe name="I1" width="620" height="413" marginwidth="3" marginheight="3" border="0" frameborder="0" src="home.htm">
To View This Page Correctly, You Will Need To Update Your INTERNET EXPLORER.</iframe></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="89" colspan="3"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
You can view the page here: http://members.shaw.ca/greg_rego/gnbtelco/
just click the picture to enter.
<html>
<head>
<meta http-equiv="Content-Langua
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Telco Power & Battery :: Main Page</title>
<base target="I1">
</head>
<!-- JavaScript for the Drop Down Menu -->
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli
[document.navform.navlist.
location.href = loc
}
</script>
<body link="#C1C497" vlink="#C1C497" alink="#C1C497" text="#C1C497" bgcolor="#000000" background="index1.jpg" topmargin="0" leftmargin="0">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="650" id="AutoNumber1" height="714">
<tr>
<td width="100%" height="714" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber2" height="617">
<tr>
<td width="100%" height="143" colspan="3"> </td>
</tr>
<tr>
<td width="33%" height="1"></td>
<td width="34%" height="1">
<!-- Drop Down Menu! -->
<form name = "navform">
<select size="1" name="navlist" onChange="jumplink(this.fo
<option value="home.htm">Main Page</option>
<option value="about.htm">About Us</option>
<option value="services.htm">Servi
<option value="portfolio.htm">Port
</select>
</form>
<p> </td>
<td width="33%" height="1"></td>
</tr>
<tr>
<td width="100%" height="423" colspan="3" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%" id="AutoNumber3" height="421">
<tr>
<td width="100%" height="421" align="center" valign="top">
<iframe name="I1" width="620" height="413" marginwidth="3" marginheight="3" border="0" frameborder="0" src="home.htm">
To View This Page Correctly, You Will Need To Update Your INTERNET EXPLORER.</iframe></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" height="89" colspan="3"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
Just reference the iframe instead of the current window when setting the location
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli st.options
[document.navform.navlist. selectedIn dex].value ;
window.frames.I1.location. href = loc;
}
</script>
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli
[document.navform.navlist.
window.frames.I1.location.
}
</script>
Change the 'src' attribute of the iframe:
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli st.options
[document.navform.navlist. selectedIn dex].value ;
window.frames.I1.src = loc;
}
</script>
<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navli
[document.navform.navlist.
window.frames.I1.src = loc;
}
</script>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Btw if you use:
<form name = "navform">
<select size="1" name="navlist" onChange="jumplink(this)"> <!-- parameter changed -->
<option value="home.htm">Main Page</option>
<option value="about.htm">About Us</option>
<option value="services.htm">Servi ces</optio n>
<option value="portfolio.htm">Port folio</opt ion>
</select>
</form>
you can change your javascript to:
<script language="JavaScript">
function jumplink(list) {
loc=list.options[list.sele ctedIndex] .value;
document.getElementById('I 1').src = loc;
}
</script>
<form name = "navform">
<select size="1" name="navlist" onChange="jumplink(this)">
<option value="home.htm">Main Page</option>
<option value="about.htm">About Us</option>
<option value="services.htm">Servi
<option value="portfolio.htm">Port
</select>
</form>
you can change your javascript to:
<script language="JavaScript">
function jumplink(list) {
loc=list.options[list.sele
document.getElementById('I
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yo i already got the winar so no more posting :P im just lazy to implement the changes and make sure they work :P
ASKER
k no none of those work.....
please post the code you use
????