Link to home
Start Free TrialLog in
Avatar of gregrego
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-Language" 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 &amp; Battery&nbsp; ::&nbsp; Main Page</title>
<base target="I1">
</head>

<!-- JavaScript for the Drop Down Menu -->

<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navlist.options
    [document.navform.navlist.selectedIndex].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">&nbsp;</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.form)">
          <option value="home.htm">Main Page</option>
          <option value="about.htm">About Us</option>
          <option value="services.htm">Services</option>
          <option value="portfolio.htm">Portfolio</option>
          </select>
        </form>


        <p>&nbsp;</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">&nbsp;</td>
      </tr>
    </table>
    </td>
  </tr>
</table>

</body>

</html>
Avatar of sciwriter
sciwriter

i would like to force the pages to open inside of the inline frame

????
Just reference the iframe instead of the current window when setting the location

<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navlist.options
   [document.navform.navlist.selectedIndex].value;
window.frames.I1.location.href = loc;
}
</script>

Change the 'src' attribute of the iframe:

<script language="JavaScript">
function jumplink(nav) {
loc=document.navform.navlist.options
  [document.navform.navlist.selectedIndex].value;
window.frames.I1.src = loc;
}
</script>
SOLUTION
Avatar of wfRGB
wfRGB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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">Services</option>
         <option value="portfolio.htm">Portfolio</option>
         </select>
   </form>

you can change your javascript to:

<script language="JavaScript">
function jumplink(list) {
loc=list.options[list.selectedIndex].value;
document.getElementById('I1').src = loc;
}
</script>
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gregrego

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
k no none of those work.....
please post the code you use