Click to See Complete Forum and Search --> : Dropdown menu with 2 types of links


Silver
01-08-2003, 01:53 PM
I'm trying to create a dropdown menu where some links open in the parent window and others open in a popup window. It seems I can do one or the other in a form, but not both. Any ideas?

Thanks.

Zach Elfers
01-08-2003, 02:00 PM
Since you mentioned you could do this in a form, I am assuming you are talking about a <select> menu.

Here is how you could do it:

<select name="selectSite" onChange="go();">
<option value="0" selected>Select a Site>>></option>
<option value="site1">Site 1</option>
<option value="page.html">Site 2</option>
</select>

Here is the script:

function go() {
if (document.formName.selectSite.value == 0) {
return;
}
if (documen.formName.selectSite.value == site1) {
parent.frameName.location.href = "page.html";
}
else {
self.location.href = document.formName.selectSite.value;
}
return true;
}

Silver
01-08-2003, 03:36 PM
thanks Zach - i must be doing something wrong cause i can't seem to get it to work. The links don't go anywhere and no popup window.