Sartavius
10-25-2011, 10:33 PM
Okay Javascript Masters, here's one for you! Lets say I want something like this:
<FORM NAME="URLlist">
<SELECT NAME="droplist">
<OPTION SELECTED="SELECTED" VALUE=" ">Select a Destination!</OPTION>
<OPTION VALUE="http://www.yoururl.com">Your Discription</OPTION>
<OPTION VALUE="http://www.yoururl1.com">Your Discription1</OPTION>
<OPTION VALUE="http://www.yoururl2com">Your Discription2</OPTION>
</SELECT><INPUT TYPE="BUTTON" VALUE="Go!" ONCLICK="GotoURL(this.form)">
<SCRIPT LANGUAGE="JavaScript">
<!--
function GotoURL(dl) {
// FRAMES - To open a selection in a document that uses frames
// change top.location.href to parent.putyourframenamehere.location.href
top.location.href = dl.droplist.options[dl.droplist.selectedIndex].value;
}
// -->
</SCRIPT>
</FORM>
Except I want the different values to open in different locations. Say a couple of them should open in the parent (of a frameset), some should open in a new window and so on.
Is this possible with the above code or am I dreaming?
<FORM NAME="URLlist">
<SELECT NAME="droplist">
<OPTION SELECTED="SELECTED" VALUE=" ">Select a Destination!</OPTION>
<OPTION VALUE="http://www.yoururl.com">Your Discription</OPTION>
<OPTION VALUE="http://www.yoururl1.com">Your Discription1</OPTION>
<OPTION VALUE="http://www.yoururl2com">Your Discription2</OPTION>
</SELECT><INPUT TYPE="BUTTON" VALUE="Go!" ONCLICK="GotoURL(this.form)">
<SCRIPT LANGUAGE="JavaScript">
<!--
function GotoURL(dl) {
// FRAMES - To open a selection in a document that uses frames
// change top.location.href to parent.putyourframenamehere.location.href
top.location.href = dl.droplist.options[dl.droplist.selectedIndex].value;
}
// -->
</SCRIPT>
</FORM>
Except I want the different values to open in different locations. Say a couple of them should open in the parent (of a frameset), some should open in a new window and so on.
Is this possible with the above code or am I dreaming?