[thelist] JS Drop-Down Nav

Nate Koechley lists at vicksburgcollective.com
Tue Jan 29 02:51:00 CST 2002


This should do it, from the Sun.com site, but changed to use the button.

<SCRIPT LANGUAGE="JavaScript">
<!--
function gotoFunction() {
        self.location =
document.productGoto.productList.options[document.productGoto.productList.se
lectedIndex].value;
}
// -->
</SCRIPT>
<FORM NAME="productGoto">
<SELECT NAME="productList">
<OPTION VALUE="#">SELECT A TOPIC
<OPTION VALUE="#">----------------------------
<OPTION VALUE="http://www.yahoo.com">Yahoo
<OPTION VALUE="http://www.google.com">Google
<OPTION VALUE="http://www.evolt.org">Evolt
</SELECT>
<INPUT TYPE="BUTTON" VALUE="Go" ALT="Go" ONCLICK="gotoFunction();">
</FORM>

Note:
The downside to using the "Go" button to fire the event is you can't then
reset the select list "onBlur" (because touching the "Go" button resets the
list before it fires the event, thereby resetting the destination to null.
(Check sun.com homepage to see onChange/onBlur in effect.

The upside is that I personally think it's a better UE to have the User
choose when to navigate -- it's sometimes difficult to micro-mouse control
for some users.

cheers,
nate

nate koechley






More information about the thelist mailing list