Dropdown Navigation in Frames

The question

I've tried to do this on my own, and even had golive generate a 'work-around' for me, but if i can reduce the amount of code THAT took and still achieve my goal, I'll be a happy camper.

I have a two-frame set up that uses the right frame for navigation (rebellious-huh?) via 4 drop-down form menus with an onChange handler. This replaces content in the left frame ok, but the last selected item remains in the menu list. I would like the new left frame to have some sort of onLoad to refresh the right frame, to reset, as it were, the menu lists. My work around in golive involves reloading the right page from an 'onLoad' in the left page, which does what I want, but unless I'm mistaken (have been before), it adds something like 70 lines of code to my page. I thought there must be a more compact way to do this?

The solution involves setting the option selected to the first element (zero to javascript) -- [ document.formname.elementname.selectedIndex=0 ] -- see the code of the-navigation.php to see how I implement it. This page is related to my other JavaScript Navigation Solutions.

Source Code for the Frameset

<frameset rows="80%,20%">
    <frame src="the-content.php" name="targetWINDOW">
    <frame src="the-navigation.php">
</frameset>
<noframes><a href="the-content.php">See The Code</a></noframes>

Source Code for the Navigation

<form action="../">
<table border="0" cellspacing="0" cellpadding="8" width="95%" height="95%">
    <tr><td align="CENTER">
<select 
    onchange="window.open(this.options[this.selectedIndex].value,'targetWINDOW');this.selectedIndex=0;">
    <option>Choose A Site</option>
    <option value="http://www.yahoo.com/">YAHOO</option>
    <option value="http://www.google.com/">GOOGLE</option>
    <option value="http://www.altavista.com/">ALTAVISTA</option>
    <option value="http://www.amazon.com/">AMAZON</option>
    <option value="http://artlung.com/">ARTLUNG</option>
</select>
    </td></tr>
</table>
</form>
blog comments powered by Disqus