[SOLVED] open in new window?
Posted: Thu Mar 11, 2004 11:50 pm
I have no knowledge of javascript and i got this script from somewhere but i want these links in the drop down box to go to a separate window when "GO" is clicked. Thanks in advance.
Code: Select all
<?
if (eregi("block-CDC_radio.php",$PHP_SELF)) { Header("Location: index.php"); die(); }
$content = "<left><form name="radio" >\n";
$content .= "<select name="music" size="1" onChange="displaydesc(document.radio.music.selectedIndex)">\n";
$content .= "<option selected>Choose station</option>\n";
// under option value place the specific link to the radio station pls file. simply add another line for each additional station you'd like
$content .= "<option value="http://www.live365.com/stations/jtava?play" target="_blank">Alternative Nation</option>\n";
$content .= "<option value="http://www.live365.com/stations/masmith?play" target="_blank">Rusty Metal Radio</option>\n";
$content .= "<option value="http://www.live365.com/stations/rock7037?play" target="_blank">X FM</option>\n";
$content .= "</select><input type="button" value="Go" onClick="location=document.radio.music.options[document.radio.music.selectedIndex].value"><br>\n";
$content .= "<span id="descriptions" align="left" style="font:italic 13px Arial">\n";
$content .= "</span> </form><script>\n";
$content .= "var textdisplay=new Array()\n";
// add the text you'd like the station to have below. for each additional station add $content .= "textdisplay[[Next Number]]="[Name of Station here]"\n";
$content .= "textdisplay[0]=""\n";
$content .= "textdisplay[1]="Alternative Nation"\n";
$content .= "textdisplay[2]="Rusty Metal Radio"\n";
$content .= "textdisplay[3]="X FM"\n";
$content .= "function displaydesc(which){\n";
$content .= "if (document.all)\n";
$content .= "descriptions.innerHTML=textdisplay[which]\n";
$content .= "else if (document.getElementById)\n";
$content .= "document.getElementById("descriptions").innerHTML=textdisplay[which]\n";
$content .= "}\n";
$content .= "displaydesc(document.radio.music.selectedIndex)\n";
$content .= "document.radio.music.options[0].selected=true\n";
$content .= "</script></p></left>";
?>