forumnz Posted January 25, 2007 Share Posted January 25, 2007 I have a list/menu... I want the user to be able to choose an option and then the page will automatically take him/her there... the options have values... how can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/35712-menu/ Share on other sites More sharing options...
Shattered Posted January 25, 2007 Share Posted January 25, 2007 [code]<select name=navi onChange="go()"><option value=''>--- Select your destination ---<option value="js.html">General Introduction<option value="placejs.html">Placing JavaScripts<option value="links.html">JavaScript Links</select>[/code][code]function go(){ box = document.forms[0].navi; destination = box.options[box.selectedIndex].value; if (destination) location.href = destination;}[/code]This might work for you. Quote Link to comment https://forums.phpfreaks.com/topic/35712-menu/#findComment-169212 Share on other sites More sharing options...
boo_lolly Posted January 25, 2007 Share Posted January 25, 2007 that is javascript, by the way. not php. Quote Link to comment https://forums.phpfreaks.com/topic/35712-menu/#findComment-169267 Share on other sites More sharing options...
Shattered Posted January 25, 2007 Share Posted January 25, 2007 It still works. And if you know a PHP version then by all means post the code. I could use it for my own project Im working on but havent had the time to quickly find one that worked. Quote Link to comment https://forums.phpfreaks.com/topic/35712-menu/#findComment-169272 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.