I have a drop-down box with various options. The question is how do I dirct the user to the desired page when they select a particular option. Is it something to do with the onChange or onFocus event handler?
Yes, the use the onChange event handler. Here's the JavaScript code that I use with my drop-down boxes to direct the user to the appropriate page. Put this code in your HEAD section:
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
Here's the code for the drop-down box. This will go in the desired location in your BODY:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.