...

View Full Version : Trouble with Double Combo script



DontKnowMuch
06-03-2003, 12:02 PM
The script is located at this page
http://javascriptkit.com/script/cut183.shtml

I cant seem to have my links open in a new window I tried target="_new" but it doesnt work. Heres what the link part for the code looks like:


group[0][0]=new Option("JavaScript Kit","http://javascriptkit.com")
group[0][1]=new Option("News.com","http://www.news.com")
group[0][2]=new Option("Wired News","http://www.wired.com")

group[1][0]=new Option("CNN","http://www.cnn.com")
group[1][1]=new Option("ABC News","http://www.abcnews.com")

group[2][0]=new Option("Hotbot","http://www.hotbot.com")
group[2][1]=new Option("Infoseek","http://www.infoseek.com")
group[2][2]=new Option("Excite","http://www.excite.com")
group[2][3]=new Option("Lycos","http://www.lycos.com")

I'm new here and hope I posted this in the right section of the forum.

Garadon
06-03-2003, 01:25 PM
try replacing this line:

location=temp.options[temp.selectedIndex].value;


with this

window.open(temp.options[temp.selectedIndex].value);

requestcode
06-03-2003, 01:27 PM
You need to change the go function using window.open.
function go(){
loc=temp.options[temp.selectedIndex].value
NewWin=window.open(loc,"win1")
}

You can also add properties to the window.open to determine the size of the window and other things.

Check out this tutorial on windows:
http://www.javascriptkit.com/javatutors/window1.shtml

DontKnowMuch
06-03-2003, 02:17 PM
Originally posted by Garadon
try replacing this line:

location=temp.options[temp.selectedIndex].value;


with this

window.open(temp.options[temp.selectedIndex].value);

Worked like a charm, thanks for your time U2 I really appreciate it:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum