i'm using a drop down table for some links, but i need the links to open ni a different window- the _top target. i've tried but failed miseralby.anyone?
I did something like this a couple of years ago, but kept it in the same window. For my example, I set up a function called 'nav' as I had several menus of this type and wanted a fuction to deal with all of them... You will need to do the same. I munged my code so it opens in a new window..
function nav ( locn) {window.open( locn )}
You can call it what you like. What you do is send the url to nav using the onchange and the fuction opens it in a new window.
Here is my code for the menu to show how it works
<form name="webmaster" class="normalform"> <select name="freebies" class="textform" onChange="nav (document.webmaster.freebies.options[selectedIndex].value)"> <option value="*"> ~~ The Basics ~~ <option value="email.shtml"> Email <option value="graphics.shtml"> Graphics <option value="midi.shtml"> Midis <option value="redirect.shtml"> Redirect URL's <option value="tutorial.shtml"> Tutorials <option value="webspace.shtml"> Web Space </select>
It is easy to implement in your code.
NB this sort of code isnt search engine friendly, so if you want to have search engines index it, use noscript tags and put html links in for all the pages used in above method. New browsers ignore anything between noscript tags so it doesnt look unsightly.
This doesnt alter the target of all your links... just opens any links from the menu in a new browser window. The fuction nav is a simple one; it justs opens the url you send it int a new window. its only called by the 'onchange' attribute.
Ok.. i misunderstood.. change this <select onchange="window.location.href=this.options[this.selectedIndex].value" size="1" class="form"> in you original code to: